JP2005251217A - Microcomputer, electronic equipment and debugging system - Google Patents
Microcomputer, electronic equipment and debugging system Download PDFInfo
- Publication number
- JP2005251217A JP2005251217A JP2005091910A JP2005091910A JP2005251217A JP 2005251217 A JP2005251217 A JP 2005251217A JP 2005091910 A JP2005091910 A JP 2005091910A JP 2005091910 A JP2005091910 A JP 2005091910A JP 2005251217 A JP2005251217 A JP 2005251217A
- Authority
- JP
- Japan
- Prior art keywords
- data
- command
- monitor
- microcomputer
- monitoring means
- 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
- 238000012545 processing Methods 0.000 claims abstract description 97
- 238000012544 monitoring process Methods 0.000 claims abstract description 75
- 230000005540 biological transmission Effects 0.000 claims description 62
- 238000000034 method Methods 0.000 claims description 55
- 230000008569 process Effects 0.000 claims description 40
- 230000006870 function Effects 0.000 claims description 19
- 230000007175 bidirectional communication Effects 0.000 claims description 5
- 230000004044 response Effects 0.000 claims description 3
- 230000006854 communication Effects 0.000 description 60
- 238000004891 communication Methods 0.000 description 60
- 238000005070 sampling Methods 0.000 description 31
- 238000010586 diagram Methods 0.000 description 18
- 101000633445 Homo sapiens Structural maintenance of chromosomes protein 2 Proteins 0.000 description 12
- 102100029540 Structural maintenance of chromosomes protein 2 Human genes 0.000 description 12
- 102100029538 Structural maintenance of chromosomes protein 1A Human genes 0.000 description 11
- 108010004731 structural maintenance of chromosome protein 1 Proteins 0.000 description 11
- 238000001514 detection method Methods 0.000 description 9
- 230000010365 information processing Effects 0.000 description 7
- QDSRUIDWGNCDAY-LIRRHRJNSA-N (2s)-2-[(2r)-1-chloro-2-hydroxypropan-2-yl]-10-hydroxy-5-methoxy-1,2-dihydrofuro[2,3-c]xanthen-6-one Chemical compound O1C2=C(O)C=CC=C2C(=O)C2=C1C(C[C@H](O1)[C@@](C)(O)CCl)=C1C=C2OC QDSRUIDWGNCDAY-LIRRHRJNSA-N 0.000 description 6
- 102100040862 Dual specificity protein kinase CLK1 Human genes 0.000 description 6
- 102100040844 Dual specificity protein kinase CLK2 Human genes 0.000 description 6
- 101000749294 Homo sapiens Dual specificity protein kinase CLK1 Proteins 0.000 description 6
- 101000749291 Homo sapiens Dual specificity protein kinase CLK2 Proteins 0.000 description 6
- 230000008901 benefit Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 239000000523 sample Substances 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 4
- 101100042788 Caenorhabditis elegans him-1 gene Proteins 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
- Microcomputers (AREA)
Abstract
【課題】 小さな命令コードサイズでオンチップデバッグ機能を実現できるマイクロコンピュータ、電子機器、デバッグシステムを提供する。
【解決手段】マイクロコンピュータは、中央処理ユニット22と、第2のモニタ手段62との間でデータを送受信し、実行するプリミティブコマンドを第2のモニタ手段62からの受信データに基づき決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段40を含む。第1のモニタ手段40は、プリミティブコマンドの命令コードを含むモニタプログラムが格納されるモニタROM42を含み、第2のモニタ手段62からの受信データはプリミティブコマンドを識別するための識別データを含む。第1のモニタ手段40は、第2のモニタ手段62から受信データを受信した場合に、受信データに含まれる識別データにより指定される命令コードのプリミティブコマンドを実行する。
【選択図】 図3PROBLEM TO BE SOLVED: To provide a microcomputer, an electronic device and a debugging system capable of realizing an on-chip debugging function with a small instruction code size.
The microcomputer transmits and receives data between the central processing unit and the second monitor means, and determines a primitive command to be executed based on the received data from the second monitor means. First monitoring means 40 for performing processing for executing the primitive command. The first monitor means 40 includes a monitor ROM 42 in which a monitor program including the instruction code of the primitive command is stored, and the received data from the second monitor means 62 includes identification data for identifying the primitive command. When receiving the reception data from the second monitoring unit 62, the first monitoring unit 40 executes the primitive command of the instruction code specified by the identification data included in the reception data.
[Selection] Figure 3
Description
本発明は、マイクロコンピュータ、マイクロコンピュータを含む電子機器、及びデバッグシステムに関する。 The present invention relates to a microcomputer, an electronic device including the microcomputer, and a debugging system.
近年、ゲーム装置、カーナビゲーションシステム、プリンタ、携帯情報端末などの電子機器に組み込まれ、高度な情報処理を実現できるマイクロコンピュータに対する需要が高まっている。そして、このような組み込み型のマイクロコンピュータは、通常、ターゲットシステムと呼ばれるユーザボードに実装される。そして、このターゲットシステムを動作させるソフトウェアの開発を支援するためにICE(In-Circuit Emulator)と呼ばれるソフトウェア開発支援ツールが広く使用されている。 In recent years, there has been an increasing demand for microcomputers that are incorporated in electronic devices such as game devices, car navigation systems, printers, and portable information terminals, and that can realize advanced information processing. Such an embedded microcomputer is usually mounted on a user board called a target system. A software development support tool called ICE (In-Circuit Emulator) is widely used to support the development of software for operating the target system.
さて、このようなICEとしては、従来、図1(A)に示すようなCPU置き換え型と呼ばれるICEが主流を占めていた。このCPU置き換え型ICEでは、デバッグ時にターゲットシステム300からマイクロコンピュータ302を取り外し、その代わりにデバッグツール304のプローブ306を接続する。そして、このデバッグツール304に、取り外したマイクロコンピュータ302の動作をエミュレートさせる。また、このデバッグツール304に、デバッグのために必要な種々の処理を行わせる。
Conventionally, as such ICE, an ICE called a CPU replacement type as shown in FIG. In this CPU replacement type ICE, the
しかしながら、このCPU置き換え型ICEには、プローブ306のピン数が多くなると共にプローブ306の線308が増えるという欠点があった。このため、マイクロコンピュータ302の高周波数動作をエミュレートすることが困難になる(例えば33MHZ程度が限界)。またターゲットシステム300の設計も困難になる。更に、マイクロコンピュータ302を実装して動作させる実動作時とデバッグツール304でマイクロコンピュータ302の動作をエミュレートするデバッグモード時とで、ターゲットシステム300の動作環境(信号のタイミング、負荷条件)が変化してしまう。またこのCPU置き換え型ICEには、マイクロコンピュータが異なれば、たとえそれが派生品であっても、設計が異なるデバッグツールや、ピン数やピンの位置が異なるプローブを使用しなければならないという問題もあった。
However, this CPU replacement type ICE has a drawback that the number of pins of the
一方、このようなCPU置き換え型ICEの欠点を解消するものとして、図1(B)に示すような、モニタプログラム310をターゲットシステム312に実装するタイプのICEが知られている。しかしながら、これまでのモニタプログラム実装型ICEでは、モニタプログラム310に、全てのデバッグコマンド(プログラムのロード、GO、ステップ実行、メモリのリード・ライト、内部レジスタのリード・ライト、ブレークポイントの設定・解除)を実行する機能を持たせる必要があった。したがって、モニタプログラム310の命令コードサイズが非常に大きくなってしまう(例えば30〜50Kバイト)。このため、ユーザが自由に使用できるメモリ領域が減ってしまうと共に、デバッグ時とデバッグ時以外でシステムが異なってしまうという問題があった。図1(B)の問題点を解決する方法として、モニタプログラムをチップ上にのせるオンチップデバッグという方法があるが、命令コードサイズが大きなモニタプログラムをチップ内に設けると、チップのサイズを大きくしてしまうという問題点がある。
On the other hand, an ICE of the type in which the
本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、小さな命令コードサイズ又は回路規模でオンチップデバッグ機能を実現できるマイクロコンピュータ、これを含む電子機器、及びデバッグシステムを提供することにある。 The present invention has been made in view of the above technical problems, and an object thereof is a microcomputer capable of realizing an on-chip debugging function with a small instruction code size or circuit scale, and an electronic apparatus including the microcomputer And providing a debugging system.
上記課題を解決するために本発明は、オンチップデバッグ機能を有するマイクロコンピュータであって、命令の実行処理を行う中央処理ユニットと、マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含み、前記第1のモニタ手段は、前記第1のモニタ手段の処理を実行するためのモニタプログラムが格納されるモニタROMを含み、前記モニタプログラムは、前記プリミティブコマンドの命令コードを含み、前記第2のモニタ手段からの前記受信データは、前記プリミティブコマンドを識別するための識別データを含み、前記第1のモニタ手段は、前記第2のモニタ手段から前記受信データを受信した場合に、前記受信データに含まれる前記識別データにより指定される命令コードのプリミティブコマンドを実行することを特徴とする。 In order to solve the above-described problems, the present invention is a microcomputer having an on-chip debugging function, and a central processing unit for executing instructions and a debugging command provided outside the microcomputer as at least one primitive command. To transmit / receive data to / from the second monitoring unit that performs processing for conversion, determine a primitive command to be executed based on the received data from the second monitoring unit, and execute the determined primitive command The first monitor means includes a monitor ROM that stores a monitor program for executing the process of the first monitor means, and the monitor program includes: Including the instruction code of the primitive command, and from the second monitor means The received data includes identification data for identifying the primitive command, and the first monitor means includes the identification data included in the received data when the received data is received from the second monitor means. A primitive command having an instruction code specified by is executed.
また本発明は、オンチップデバッグ機能を有するマイクロコンピュータであって、命令の実行処理を行う中央処理ユニットと、マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、前記中央処理ユニットの命令実行処理に使用され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられる制御レジスタとを含み、前記第2のモニタ手段は、前記デバッグコマンドであるステップ実行コマンドを、ステップ実行イネーブルビットへのライトコマンドである第1のプリミティブコマンドと、GOコマンドである第2のプリミティブコマンドに変換し、前記第1のモニタ手段は、前記第1、第2のプリミティブコマンドを実行することで、ステップ実行処理を行うことを特徴とする。 The present invention also relates to a microcomputer having an on-chip debugging function, comprising: a central processing unit that executes instruction execution processing; and processing for converting a debug command into at least one primitive command provided outside the microcomputer. Data is transmitted / received to / from the second monitoring means to be executed, a primitive command to be executed is determined based on the received data from the second monitoring means, and a process for executing the determined primitive command is performed. And a control register which is used for instruction execution processing of the central processing unit and whose address is allocated on the memory map in the debug mode, wherein the second monitoring means is a step which is the debug command. Execute command, step execution enable bit A first primitive command that is a write command to the second command and a second primitive command that is a GO command, and the first monitoring means executes the first and second primitive commands, thereby performing a step. An execution process is performed.
また本発明は、オンチップデバッグ機能を有するマイクロコンピュータであって、命令の実行処理を行う中央処理ユニットと、マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、前記第2のモニタ手段からの前記受信データを一時的に蓄えるための受信バッファと、前記第2のモニタ手段への送信データを一時的に蓄えるための送信バッファとを含み、前記第2のモニタ手段からの前記受信データは、前記プリミティブコマンドを識別するための識別データを含み、前記第1のモニタ手段は、前記受信データの識別データがリードコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからリードアドレスを取得し、取得した前記リードアドレスからデータをリードし、リードした前記データを前記送信バッファにライトし、前記受信データの識別データがライトコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからライトアドレスとライトデータを取得し、取得した前記ライトアドレスに、取得した前記ライトデータを書き込む処理を行うことを特徴とする。 The present invention also relates to a microcomputer having an on-chip debugging function, comprising: a central processing unit that executes instruction execution processing; and processing for converting a debug command into at least one primitive command provided outside the microcomputer. Data is transmitted / received to / from the second monitoring means to be executed, a primitive command to be executed is determined based on the received data from the second monitoring means, and a process for executing the determined primitive command is performed. Monitoring means, a reception buffer for temporarily storing the reception data from the second monitoring means, and a transmission buffer for temporarily storing transmission data to the second monitoring means, The received data from the second monitor means identifies the primitive command. The first monitor means obtains a read address from the received data in the reception buffer when the identification data of the received data indicates a primitive command of a read command; When data is read from the acquired read address, the read data is written to the transmission buffer, and the identification data of the reception data indicates a primitive command of a write command, the data of the reception buffer A write address and write data are acquired from received data, and the process of writing the acquired write data to the acquired write address is performed.
また本発明は、前記第1のモニタ手段は、受信した識別データが外部ルーチンジャンプコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからルーチンアドレスを取得して外部ルーチンにジャンプし、ジャンプ後に前記第1のモニタ手段の処理にリターンする処理を行うことを特徴とする。 According to the present invention, when the received identification data indicates a primitive command of an external routine jump command, the first monitor means acquires a routine address from the received data in the reception buffer and externally A jump is made to the routine, and after the jump, a process of returning to the process of the first monitoring means is performed.
また本発明は、前記中央処理ユニットの内部レジスタの内容が退避され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられるモニタRAMを含み、前記第1のモニタ手段は、受信した識別データがGOコマンドのプリミティブコマンドを示すものであった場合には、前記モニタRAMに退避したデータを前記内部レジスタにリストアし、リストア後にユーザプログラムの処理にリターンする処理を行うことを特徴とする。 Further, the present invention includes a monitor RAM in which the contents of the internal register of the central processing unit are saved and the address is assigned on the memory map in the debug mode. The first monitor means receives the identification data as GO If the command indicates a primitive command, the data saved in the monitor RAM is restored to the internal register, and the process of returning to the process of the user program after the restoration is performed.
また本発明は、マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含み、前記第1のモニタ手段は、前記第1のモニタ手段の処理を実行するためのモニタプログラムが格納されるモニタROMを含み、前記モニタプログラムは、前記プリミティブコマンドの命令コードを含み、前記第2のモニタ手段からの前記受信データは、前記プリミティブコマンドを識別するための識別データを含み、前記第1のモニタ手段は、前記第2のモニタ手段から前記受信データを受信した場合に、前記受信データに含まれる前記識別データにより指定される命令コードのプリミティブコマンドを実行することを特徴とする。 The present invention is also a debug system for a target system including a microcomputer, the second monitor means for performing processing for converting a debug command issued by a host system into at least one primitive command, A first monitor that transmits and receives data to and from the second monitoring means, determines a primitive command to be executed based on the received data from the second monitoring means, and performs processing for executing the determined primitive command The first monitor means includes a monitor ROM in which a monitor program for executing the processing of the first monitor means is stored, and the monitor program includes an instruction code of the primitive command. , The received data from the second monitor means is the primitive. Including identification data for identifying a command, and the first monitor means, when receiving the received data from the second monitor means, an instruction code specified by the identification data included in the received data The primitive command is executed.
また本発明は、マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、前記中央処理ユニットの命令実行処理に使用され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられる制御レジスタとを含み、前記第2のモニタ手段は、前記デバッグコマンドであるステップ実行コマンドを、ステップ実行イネーブルビットへのライトコマンドである第1のプリミティブコマンドと、GOコマンドである第2のプリミティブコマンドに変換し、前記第1のモニタ手段は、前記第1、第2のプリミティブコマンドを実行することで、ステップ実行処理を行うことを特徴とする。 The present invention is also a debug system for a target system including a microcomputer, the second monitor means for performing processing for converting a debug command issued by a host system into at least one primitive command, A first monitor that transmits and receives data to and from the second monitoring means, determines a primitive command to be executed based on the received data from the second monitoring means, and performs processing for executing the determined primitive command And a control register which is used for instruction execution processing of the central processing unit and whose address is allocated on the memory map in the debug mode, the second monitoring means is a step execution command which is the debug command To the step execution enable bit. The first monitor command is converted into a first primitive command that is a command and a second primitive command that is a GO command, and the first monitoring means executes the first and second primitive commands, thereby performing step execution processing. It is characterized by performing.
また本発明は、マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、前記第2のモニタ手段からの前記受信データを一時的に蓄えるための受信バッファと、前記第2のモニタ手段への送信データを一時的に蓄えるための送信バッファとを含み、前記第2のモニタ手段からの前記受信データは、前記プリミティブコマンドを識別するための識別データを含み、前記第1のモニタ手段は、前記受信データの識別データがリードコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからリードアドレスを取得し、取得した前記リードアドレスからデータをリードし、リードした前記データを前記送信バッファにライトし、前記受信データの識別データがライトコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからライトアドレスとライトデータを取得し、取得した前記ライトアドレスに、取得した前記ライトデータを書き込む処理を行うことを特徴とする。 The present invention is also a debug system for a target system including a microcomputer, the second monitor means for performing processing for converting a debug command issued by a host system into at least one primitive command, A first monitor that transmits and receives data to and from the second monitoring means, determines a primitive command to be executed based on the received data from the second monitoring means, and performs processing for executing the determined primitive command Means, a reception buffer for temporarily storing the reception data from the second monitoring means, and a transmission buffer for temporarily storing transmission data to the second monitoring means, The received data from the second monitoring means is an identification data for identifying the primitive command. The first monitor means obtains a read address from the received data in the receive buffer, if the identification data of the received data indicates a primitive command of a read command, When data is read from the read address, the read data is written to the transmission buffer, and the identification data of the reception data indicates a primitive command of a write command, the reception data of the reception buffer The write address and the write data are acquired from the data, and the process of writing the acquired write data to the acquired write address is performed.
また本発明は、オンチップデバッグ機能を有するマイクロコンピュータであって、命令の実行処理を行う中央処理ユニットと、マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含むことを特徴とする。 The present invention also relates to a microcomputer having an on-chip debugging function, comprising: a central processing unit that executes instruction execution processing; and processing for converting a debug command into at least one primitive command provided outside the microcomputer. Data is transmitted / received to / from the second monitoring means to be executed, a primitive command to be executed is determined based on the received data from the second monitoring means, and a process for executing the determined primitive command is performed. And monitoring means.
本発明によれば、マイクロコンピュータの外部に設けられた第2のモニタ手段が、ホストシステム等が発行したデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。そして、第1のモニタ手段は、この第2のモニタ手段からデータを受信し、この受信データに基づいて決定されたプリミティブコマンドを実行するための処理を行う。本発明によれば、第1のモニタ手段の処理を実行するためのモニタプログラムに、各デバッグコマンドを実行するための複雑なルーチンを持たせる必要がなくなる。したがって、モニタプログラムの命令コードサイズを格段に小さくできるようになり、小さなハードウェア規模でオンチップデバッグ機能を実現できるようになる。 According to the present invention, the second monitoring means provided outside the microcomputer performs processing for converting (decomposing) a debug command issued by the host system or the like into a primitive command. The first monitor means receives data from the second monitor means and performs a process for executing the primitive command determined based on the received data. According to the present invention, the monitor program for executing the process of the first monitor means does not need to have a complicated routine for executing each debug command. Therefore, the instruction code size of the monitor program can be remarkably reduced, and an on-chip debugging function can be realized with a small hardware scale.
また本発明は、前記プリミティブコマンドが、ユーザプログラムの実行を開始するコマンド、デバッグモード時におけるメモリマップ上のアドレスにデータをライトするコマンド、及び前記メモリマップ上のアドレスからデータをリードするコマンドを含むことを特徴とする。このようにプリミティブコマンドをシンプルにすることで、モニタプログラムの命令コードサイズを更に小さくできるようになる。 In the present invention, the primitive command includes a command for starting execution of a user program, a command for writing data to an address on a memory map in a debug mode, and a command for reading data from an address on the memory map. It is characterized by that. Thus, by simplifying the primitive command, the instruction code size of the monitor program can be further reduced.
また本発明は、前記中央処理ユニットの命令実行処理に使用され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられる制御レジスタを含むことを特徴とする。このようにすれば、デバッグモード時に制御レジスタを用いたデバッグ処理を行うことが可能になり、処理の簡易化、ハードウェアの小規模化を図れるようになる。 The present invention is also characterized in that it includes a control register which is used for instruction execution processing of the central processing unit and whose address is allocated on a memory map in debug mode. In this way, it becomes possible to perform a debugging process using the control register in the debug mode, thereby simplifying the process and reducing the hardware scale.
また本発明は、前記中央処理ユニットの内部レジスタの内容が退避され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられるモニタRAMを含むことを特徴とする。このようにすれば、デバッグモード時に、内部レジスタの内容をリードしたりすることが可能になり、より多様なデバッグ機能を実現できるようになる。 The present invention also includes a monitor RAM in which the contents of the internal register of the central processing unit are saved and the address is allocated on the memory map in the debug mode. In this way, it is possible to read the contents of the internal register in the debug mode, thereby realizing a wider variety of debug functions.
また本発明は、前記第2のモニタ手段との間で半2重の双方向通信を行うための1本の双方向通信ラインが接続される端子を含み、スレーブとなる前記第1のモニタ手段が、マスタとなる前記第2のモニタ手段からデータを受信したことを条件に、該受信データに対応する処理を行い該受信データに対応する応答データを前記第2のモニタ手段に送信することを特徴とする。このようにすれば、マイクロコンピュータの端子(ピン)数を減らすことが可能となり、マイクロコンピュータの低コスト化を図れるようになる。また、第1、第2のモニタ手段の間の通信プロトコルを単純化でき、モニタプログラムの命令コードサイズを更に小さくできるようになる。 The present invention also includes a terminal to which one bidirectional communication line for performing half-duplex bidirectional communication with the second monitoring means is connected, and the first monitoring means serving as a slave. On the condition that data has been received from the second monitoring means serving as a master, and performing processing corresponding to the received data and transmitting response data corresponding to the received data to the second monitoring means. Features. In this way, the number of terminals (pins) of the microcomputer can be reduced, and the cost of the microcomputer can be reduced. Further, the communication protocol between the first and second monitoring means can be simplified, and the instruction code size of the monitor program can be further reduced.
また本発明は、前記第2のモニタ手段からの受信データが、前記第1のモニタ手段が実行するプリミティブコマンドの識別データを含むことを特徴とする。このようにすることで、プリミティブコマンドの実行の指示を簡易に第2のモニタ手段から第1のモニタ手段に伝えることが可能になる。 Further, the invention is characterized in that the received data from the second monitor means includes identification data of a primitive command executed by the first monitor means. In this way, it is possible to easily transmit an instruction to execute a primitive command from the second monitor unit to the first monitor unit.
また本発明は、前記第1のモニタ手段が、前記第2のモニタ手段との間で固定長のデータを送受信することを特徴とする。このようにすることで、第1のモニタ手段のモニタプログラムの命令コードサイズを更に小さくすることが可能になる。 Further, the present invention is characterized in that the first monitor means transmits and receives fixed-length data to and from the second monitor means. By doing so, it is possible to further reduce the instruction code size of the monitor program of the first monitor means.
また本発明は、前記第1のモニタ手段の処理を実行するためのモニタプログラムがROMに格納されていることを特徴とする。このようにすることで、RAMに比べて占有面積の小さいROMにモニタプログラムが格納されると共に、モニタプログラムをRAMにロードするロジック回路等が不要になる。したがって、マイクロコンピュータの更なる小規模化を図れるようになる。 The present invention is also characterized in that a monitor program for executing the processing of the first monitor means is stored in a ROM. By doing so, the monitor program is stored in a ROM that occupies a smaller area than the RAM, and a logic circuit for loading the monitor program into the RAM becomes unnecessary. Therefore, the microcomputer can be further downsized.
また本発明は、前記第1のモニタ手段が、第1のクロックを分周し、調歩同期式で送受信されるデータの各ビットをサンプリングするための第1のサンプリングクロックを生成する第1の分周回路と、前記第1のサンプリングクロックに基づいてデータを送受信する回路とを含み、前記第1のモニタ手段が、前記第2のモニタ手段が含む第2の分周回路が第2のサンプリングクロックを生成するための信号として、前記第1のクロックを、前記第2のモニタ手段に供給することを特徴とする。このように、サンプリングクロックを生成するための第1のクロックを第1、第2のモニタ手段で共有することで、通信データのサンプリングエラーの発生率を格段に低くすることが可能になると共に、通信速度の最適化、高速化を図れるようになる。 According to the present invention, the first monitor means divides the first clock and generates a first sampling clock for sampling each bit of data transmitted and received in an asynchronous manner. And a circuit for transmitting and receiving data based on the first sampling clock, wherein the first monitor means is a second frequency divider circuit included in the second monitor means is a second sampling clock. The first clock is supplied to the second monitor means as a signal for generating the signal. Thus, by sharing the first clock for generating the sampling clock between the first and second monitoring means, it is possible to significantly reduce the rate of occurrence of sampling errors in communication data, Communication speed can be optimized and increased.
また本発明は、前記第1のモニタ手段がリード及びライト可能なモニタRAMを含み、前記第1のモニタ手段が、ユーザプログラムの実行がブレークしデバッグモードに移行した場合に、前記中央処理ユニットのプログラムカウンタ値及び内部レジスタの内容を前記モニタRAMに待避することを特徴とする。このようにすることで、デバッグモードからユーザプログラム実行モードに戻った時に適正にユーザプログラムを実行できるようになる。また第1のモニタ手段が内部レジスタの内容等を利用して各種の処理を行うことも可能になる。 The present invention also includes a monitor RAM in which the first monitor means is readable and writable. When the first monitor means breaks the execution of the user program and shifts to the debug mode, the central processing unit The program counter value and the contents of the internal register are saved in the monitor RAM. By doing so, the user program can be properly executed when returning from the debug mode to the user program execution mode. Further, the first monitor means can perform various processes using the contents of the internal register.
また本発明に係る電子機器は、上記のいずれかのマイクロコンピュータと、前記マイクロコンピュータの処理対象となるデータの入力源と、前記マイクロコンピュータにより処理されたデータを出力するための出力装置とを含むことを特徴とする。このようにすれば、電子機器を動作させるプログラムなどのデバッグ作業の効率化を図れるようになり、電子機器の開発期間の短縮化、低コスト化を図れるようになる。 An electronic apparatus according to the present invention includes any one of the above microcomputers, an input source of data to be processed by the microcomputer, and an output device for outputting data processed by the microcomputer. It is characterized by that. In this way, it becomes possible to improve the efficiency of debugging work such as a program for operating the electronic device, thereby shortening the development period of the electronic device and reducing the cost.
また本発明は、マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含むこ 本発明によれば、第1のモニタ手段の処理を実行するためのモニタプログラムの命令コードサイズを格段に小さくできる。これにより、ユーザが自由に使用できるメモリ領域を増やすことが可能になる。また、ターゲットシステムを、実動作時の環境と同一の環境でデバッグできるデバッグシステムを提供できるようになる。 The present invention is also a debug system for a target system including a microcomputer, the second monitor means for performing processing for converting a debug command issued by a host system into at least one primitive command, A first monitor that transmits and receives data to and from the second monitoring means, determines a primitive command to be executed based on the received data from the second monitoring means, and performs processing for executing the determined primitive command According to the present invention, the instruction code size of the monitor program for executing the processing of the first monitor means can be remarkably reduced. This makes it possible to increase the memory area that the user can freely use. In addition, it is possible to provide a debugging system that can debug the target system in the same environment as the actual operating environment.
以下、本発明の好適な実施形態について図面を用いて詳細に説明する。 DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
1.本実施形態の特徴
まず本実施形態の特徴について図2を用いて説明する。
1. Features of this embodiment First, features of this embodiment will be described with reference to FIG.
図2に示すように、本実施形態では、マイクロコンピュータ10が、CPU(中央処理ユニット)12及び本実施形態の要部であるミニモニタ部(第1のモニタ手段)14を含む。また、マイクロコンピュータ10の外部にはメインモニタ部(第2のモニタ手段)16が設けられている。ここでメインモニタ部16は、例えばホストシステムなどが発行したデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。また、ミニモニタ部14は、メインモニタ部16との間でデータを送受信する。そして、ミニモニタ部14は、実行するプリミティブコマンドを、メインモニタ部16からの受信データに基づいて決定し、プリミティブコマンドを実行するための処理を行う。
As shown in FIG. 2, in the present embodiment, the
ここで、メインモニタ部16の変換処理の対象となるデバッグコマンドとしては、プログラムロード、GO、ステップ実行、メモリライト、メモリリード、内部レジスタライト、内部レジスタリード、ブレークポイント設定、ブレークポイント解除などのコマンドを考えることができる。メインモニタ部16は、これらの多様で複雑なデバッグコマンドを、例えばGO、ライト(デバッグモード時におけるメモリマップ上の所与のアドレスへのライト)、リード(メモリマップ上の所与のアドレスからのリード)などの、シンプルでプリミティブなコマンドに変換する処理を行う。このようにすることで、ミニモニタ部14の処理を行うミニモニタプログラムの命令コードサイズを格段に小さくすることができる。これにより、マイクロコンピュータ10のオンチップデバッグ機能を実現できるようになる。
Here, debug commands to be converted by the
即ち、図1(B)に示すようなタイプのICEでは、モニタプログラム310は、プログラムロード、GO、ステップ実行などのデバッグコマンドの全ての処理ルーチンを有している。このため、モニタプログラム310の命令コードサイズが非常に大きくなり(例えば30〜50Kバイト)、モニタプログラム310をマイクロコンピュータ314に内蔵することは事実上困難となる。
That is, in the ICE of the type shown in FIG. 1B, the
これに対して、本実施形態では、ミニモニタ部14の処理を行うミニモニタプログラムは、GO、ライト、リードなどのシンプルなプリミティブコマンドの処理ルーチンのみを有し、命令コードサイズが非常に小さい(例えば256バイト)。したがって、ミニモニタプログラムをマイクロコンピュータ10に内蔵することが可能となり、オンチップデバッグ機能を実現できるようになる。また、ユーザが自由に使用できるメモリ領域の減少を最小限に抑える、あるいは全く減少させないようにすることが可能になる。
On the other hand, in the present embodiment, the mini monitor program that performs processing of the
2.詳細な構成例
図3に本実施形態のマイクロコンピュータ及びデバッグシステムの詳細な構成例を示す。図3に示すように、マイクロコンピュータ20は、CPU22、BCU(バス制御ユニット)26、内部メモリ(ミニモニタROM42及びミニモニタRAM44以外の内部ROM及び内部RAM)28、クロック生成部30、ミニモニタ部40(第1のモニタ手段)、トレース部50を含む。
2. Detailed Configuration Example FIG. 3 shows a detailed configuration example of the microcomputer and debug system of the present embodiment. As shown in FIG. 3, the
ここでCPU22は、種々の命令の実行処理を行うものであり、内部レジスタ24を含む。内部レジスタ24は、汎用レジスタであるR0〜R15や、特殊レジスタであるSP(スタックポインタレジスタ)、AHR(積和結果データの上位レジスタ)、ALR(積和結果データの下位レジスタ)などを含む。
Here, the
BCU26はバスを制御するものである。例えば、CPU22に接続されるハーバードアーキテクチャのバス31や、内部メモリ28に接続されるバス32や、外部メモリ36に接続される外部バス33や、ミニモニタ部40、トレース部50などに接続される内部バス34の制御を行う。
The
またクロック生成部30は、マイクロコンピュータ20内で使用される各種のクロックを生成するものである。クロック生成部30はBCLKを介して外部のデバッグツール60にもクロックを供給している。
The
ミニモニタ部40は、ミニモニタROM42、ミニモニタRAM44、制御レジスタ46、SIO48を含む。
The
ここで、ミニモニタROM42には、ミニモニタプログラムが格納される。本実施形態では、このミニモニタプログラムは、GO、リード、ライトなどのシンプルでプリミティブなコマンドの処理のみを行うようになっている。このため、ミニモニタROM42のメモリ容量を例えば256バイト程度に抑えることができ、オンチップデバッグ機能を持たせながらマイクロコンピュータ20を小規模化できるようになる。
Here, the
ミニモニタRAM44には、デバッグモードへの移行時に(ユーザプログラムのブレーク発生時に)、CPU22の内部レジスタ24の内容が退避される。これにより、デバッグモードの終了後にユーザプログラムの実行を適正に再スタートできるようになる。また内部レジスタの内容のリード等を、ミニモニタプログラムが持つプリミティブなリードコマンド等で実現できるようになる。
The content of the
制御レジスタ46は、各種のデバッグ処理を制御するためのレジスタであり、ステップ実行イネーブルビット、ブレークイネーブルビット、ブレークアドレスビット、トレースイネーブルビットなどを有する。ミニモニタプログラムにより動作するCPU22が制御レジスタ46の各ビットにデータをライトしたり、各ビットのデータをリードすることで、各種のデバッグ処理が実現される。
The control register 46 is a register for controlling various debugging processes, and includes a step execution enable bit, a break enable bit, a break address bit, a trace enable bit, and the like. Various debugging processes are realized by the
SIO48は、マイクロコンピュータ20の外部に設けられたデバッグツール60との間でデータを送受信するためのものである。SIO48とデバッグツール60との間は、TXD/RXD(データ送受信ライン)で接続されている。
The
トレース部50は、リアルタイムトレース機能を実現するためのものである。トレース部50とデバッグツール60との間は、CPU22の命令実行のステートを表す3ビットのDST[2:0]と、分岐先のPC(プログラムカウンタ)値を表すDPCOという4本のラインで接続されている。
The
デバッグツール60はメインモニタ部62を含み、パーソナルコンピュータ等により実現されるホストシステム66に接続される。ホストシステム66が、ユーザの操作により、プログラムロード、ステップ実行などのデバッグコマンドを発行すると、メインモニタ部62が、このデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。そして、メインモニタ部62が、プリミティブコマンドの実行を指示するデータをミニモニタ部40に送信すると、ミニモニタ部40が、指示されたプリミティブコマンドを実行するための処理を行うことになる。
The
図4に、デバッグモード時のメモリマップの例を示す。図4のD1、D2、D3に示すように、デバッグモード時には、図3の制御レジスタ46、ミニモニタRAM44、ミニモニタROM42のアドレスも、メモリマップ上に割り付けられる。
FIG. 4 shows an example of a memory map in the debug mode. As indicated by D1, D2, and D3 in FIG. 4, in the debug mode, the addresses of the
3.プリミティブコマンドへの変換
図5(A)、(B)、(C)、(D)に、各種のデバッグコマンドをプリミティブコマンドへ変換する処理について模式的に示す。
3. Conversion to Primitive Command FIGS. 5A, 5B, 5C, and 5D schematically show processing for converting various debug commands to primitive commands.
例えば図5(A)に示すように、(ADD・・・、SUB・・・、AND・・・、OR・・・、XOR・・・、LD.W・・・)という12バイトのプログラムを80010h番地にロードするというデバッグコマンドが発行されたとする。この場合、このプログラムロードコマンドは、ライト(80010h、ADD・・・、SUB)、ライト(80014h、AND・・・、OR・・・)、ライト(80018h、XOR・・・、LD.W・・・)という3つのプリミティブなライトコマンドに変換される。即ち、ミニモニタプログラムが、この3つのプリミティブなライトコマンドを実行することで、プログラムロードコマンドが実現されるようになる。 For example, as shown in FIG. 5A, a 12-byte program (ADD ..., SUB ..., AND ..., OR ..., XOR ..., LD.W ...) Assume that a debug command for loading at address 80010h is issued. In this case, the program load command includes write (80010h, ADD ..., SUB), write (80013h, AND ..., OR ...), write (80018h, XOR ..., LD.W ... .) Is converted into three primitive write commands. That is, the program load command is realized by the mini monitor program executing these three primitive write commands.
また図5(B)に示すようにステップ実行コマンドというデバッグコマンドが発行されたとする。すると、このステップ実行コマンドは、図3の制御レジスタ46のステップ実行イネーブルビットへのライトコマンド(図4のD1のアドレスへのライトコマンド)とGOコマンドに変換される。即ち、ミニモニタプログラムが、このプリミティブなライトコマンドとGOコマンドを実行することで、ステップ実行コマンドが実現されるようになる。
Assume that a debug command called a step execution command is issued as shown in FIG. Then, this step execution command is converted into a write command to the step execution enable bit of the
また図5(C)に示すように内部レジスタリードコマンドというデバッグコマンドが発行されたとする。すると、この内部レジスタリードコマンドは、メモリマップ上のミニモニタRAM44(内部レジスタの内容の退避先)からのリードコマンド(図4のD2のアドレスからのリードコマンド)に変換される。即ち、ミニモニタプログラムが、このプリミティブなリードコマンドを実行することで、内部レジスタリードコマンドが実現されるようになる。内部レジスタライトコマンド、メモリリードコマンド、メモリライトコマンドも同様にして実現される。 Assume that a debug command called an internal register read command is issued as shown in FIG. Then, the internal register read command is converted into a read command (read command from the address D2 in FIG. 4) from the mini-monitor RAM 44 (a save destination of the contents of the internal register) on the memory map. That is, when the mini monitor program executes this primitive read command, the internal register read command is realized. The internal register write command, memory read command, and memory write command are also realized in the same manner.
また図5(D)に示すようにブレークポイント設定コマンドというデバッグコマンドが発行されたとする。すると、このブレークポイント設定コマンドは、制御レジスタ46のブレークイネーブルビット及びブレークアドレスビットへのライトコマンドに変換される。即ち、ミニモニタプログラムが、このプリミティブなライトコマンドを実行することで、ブレークポイント設定コマンドが実現されるようになる。
Assume that a debug command called a breakpoint setting command is issued as shown in FIG. Then, this breakpoint setting command is converted into a write command to the break enable bit and break address bit of the
このように本実施形態では、複雑で多様なデバッグコマンドが、プリミティブでシンプルなリード、ライト、GOコマンドに変換される。そして、ミニモニタプログラムは、このプリミティブなリード、ライト、GOコマンドを実行するだけでよいため、ミニモニタプログラムの命令コードサイズは非常に小さくなる。この結果、ミニモニタROM42のメモリ容量も小さくでき、小さなハードウェア規模でオンチップデバッグ機能を実現できるようになる。
As described above, in this embodiment, complicated and various debug commands are converted into primitive, simple read, write, and GO commands. Since the mini-monitor program only needs to execute these primitive read, write, and GO commands, the instruction code size of the mini-monitor program becomes very small. As a result, the memory capacity of the
4.SIOの構成例
図6にSIO48の構成例を示す。SIO48は、送受信バッファ70、シフトレジスタ76、送受信切替部78、クロック制御部80及び制御レジスタ84を含む。
4). Configuration Example of SIO FIG. 6 shows a configuration example of the
ここで送受信バッファ70は、送信データ、受信データを一時的に蓄えるためのものであり、送信バッファ72、受信バッファ74を有する。シフトレジスタ76は、送信バッファ72からの送信データをパラレルデータからシリアルデータに変換し送受信切替部78に出力する機能を有する。また送受信切替部78からの受信データをシリアルデータからパラレルデータに変換し受信バッファ74に出力する機能も有する。送受信切替部78は、データの送信と受信とを切り替えるためのものである。これにより、TXD/RXDを使用した半2重のデータ送受信が可能になる。
Here, the transmission /
クロック制御部80は、内蔵する分周回路82によりBCLKを分周し、この分周により得られたサンプリングクロックSMC1をシフトレジスタ76に出力する。シフトレジスタ76は、このSMC1に基づき動作する。またクロック制御部80は、デバッグツール60にBCLKを供給する。これにより、マイクロコンピュータ20とデバッグツール60により、BCLKが共有されるようになる。
The clock control unit 80 divides BCLK by the built-in frequency dividing circuit 82, and outputs the
分周回路82での分周比は制御レジスタ84により設定される。即ちCPU22により実行されるミニモニタプログラムが、所望の分周比を制御レジスタ84に書き込むことで、分周回路82での分周比が設定されることになる。なお、制御レジスタ84のアドレスも、図3の制御レジスタ46と同様に、図4のD1の位置に割り付けられている。
The frequency dividing ratio in the frequency dividing circuit 82 is set by the control register 84. That is, the mini monitor program executed by the
5.デバッグツールの構成例
図7にデバッグツール60の構成例を示す。
5). Configuration Example of Debug Tool FIG. 7 shows a configuration example of the
CPU90は、ROM108に格納されるプログラムを実行したり、デバッグツール60の全体の制御を行うものである。送受信切替部92は、データの送信と受信とを切り替えるためのものである。クロック制御部94は、CPU90のSCLK端子、アドレスアップカウンタ100、トレースメモリ104に供給するクロックを制御するものである。このクロック制御部94には、マイクロコンピュータ20(SIO48)からのBCLKが入力される。クロック制御部94は周波数検出回路95、分周回路96を含む。周波数検出回路95は、BCLKの周波数が属する周波数範囲を検出して、その結果を制御レジスタ98に出力する。また分周回路96での分周比は制御レジスタ98により制御される。即ちCPU90により実行されるメインモニタプログラム(メインモニタROM110に格納)が、制御レジスタ98からBCLKの周波数範囲を読み出す。そして、メインモニタプログラムは、この周波数範囲に応じた最適な分周比を決定し、この分周比を制御レジスタ98に書き込む。そして、分周回路96は、この分周比でBCLKを分周してSMC2を生成し、CPU90のSCLK端子に出力する。
The
アドレスアップカウンタ100は、トレースメモリのアドレスをカウントアップするためのものである。セレクタ102は、ライン122(アドレスアップカウンタ100が出力するアドレス)とライン124(アドレスバス120からのアドレス)のいずれかを選択し、トレースメモリ104のアドレス端子にデータを出力する。またセレクタ106は、ライン126(図3のトレース部50の出力であるDST[2:0]、DPCO)とライン128(データバス118)のいずれかを選択し、トレースメモリ104のデータ端子にデータを出力したり、データ端子からデータを取り出す。
The address up
ROM108はメインモニタROM110(図3のメインモニタ部62に相当)を含み、メインモニタROM110には、メインモニタプログラムが格納される。このメインモニタプログラムは、図5(A)〜図5(D)で説明したように、デバッグコマンドをプリミティブコマンドに変換するための処理を行う。RAM112は、CPU90のワーク領域となるものである。
The
RS232Cインターフェース114、パラレルインターフェース116は、図3のホストシステム66とのインターフェースとなるものであり、ホストシステム66からのデバッグコマンドはこれらのインターフェースを介してCPU90に入力されることになる。クロック生成部118は、CPU90を動作させるクロックなどを生成するものである。
The
次に本実施形態でのリアルタイムトレース処理について簡単に説明する。本実施形態では、図3のCPU22の命令実行のステートを表す3ビットのDST[2:0]と、分岐先のPC値を表すDPCOをトレースメモリ104に蓄える。そして、トレースメモリ104に蓄えられたデータと、ユーザプログラムのソースコードとに基づいて、トレースデータを合成する。このようにすることで、マイクロコンピュータ20とデバッグツール60との間の接続ラインの本数を少なくしながら、リアルタイムトレース機能を実現することが可能になる。
Next, the real-time trace processing in this embodiment will be briefly described. In the present embodiment, 3-bit DST [2: 0] representing the instruction execution state of the
ユーザプログラム実行モードにおいては、ライン122が選択され、セレクタ102を介してアドレスアップカウンタ100の出力がトレースメモリ104のアドレス端子に入力される。また、ライン126が選択され、セレクタ106を介してDST[2:0]、DPCOがトレースメモリ105のデータ端子に入力される。ここでアドレスアップカウンタ100には、まず最初に、データバス118、アドレスバス120を用いてCPU90により図8(A)に示すようなスタートアドレスが設定される。またアドレスアップカウンタ100のST/SP(開始/停止)端子には、トレース範囲を特定するDST[2]のラインが接続される。そして図8(B)に示すように、DST[2]のラインに第1のパルス130が入力されると、アドレスアップカウンタ100のアドレスアップカウントが開始する。そして、DST[2]のラインに第2のパルス132が入力されると、アドレスアップカウンタ100のアドレスアップカウントが停止し、トレース動作が停止する。このようにして、所望のトレース範囲でのデータ(DST[2:0]、DPCO)をトレースメモリ104に蓄えることが可能になる。
In the user program execution mode, the line 122 is selected, and the output of the address up
一方、ユーザプログラム実行モードからデバッグモードに移行すると、ライン124が選択され、セレクタ102を介してアドレスバス120からのアドレスがトレースメモリ104のアドレス端子に入力される。またライン128が選択され、セレクタ106を介してトレースメモリ104からのデータがデータバス118に出力される。これにより、トレースメモリ104に蓄えられたデータ(DST[2:0]、DPCO)を、デバッグモード時にCPU90(メインモニタプログラム)が読み出すことが可能になる。そして、読み出されたデータとユーザープログラムのソースコードとに基づいて、トレースデータを合成することが可能になる。
On the other hand, when shifting from the user program execution mode to the debug mode, the
6.データの送受信
さて、図9(A)に示すように、ミニモニタ部40とメインモニタ部62の間でのデバッグデータの通信の手法としては、TXD(送信)とRXD(受信)のラインを別々に設け、全2重で通信する手法が考えられる。
6). Transmission / Reception of Data As shown in FIG. 9A, as a method of communication of debug data between the
しかしながら、このようにデバッグデータの通信のために2本のライン(端子)を使用してしまうと、その分だけマイクロコンピュータの端子数(ピン数)が増えてしまい、これはマイクロコンピュータの高コスト化を招く。 However, if two lines (terminals) are used for communication of debug data in this way, the number of terminals (number of pins) of the microcomputer increases accordingly, which is a high cost of the microcomputer. Invite
そこで本実施形態では、図9(B)に示すように、ミニモニタ部40とメインモニタ部62との間に1本のTXD/RXDライン(双方向通信ライン)を設け、半2重の双方向通信を行う。このようにすることで、マイクロコンピュータの端子数の増加を最小限に抑えることができ、マイクロコンピュータの低コスト化を図れる。
Therefore, in the present embodiment, as shown in FIG. 9B, a single TXD / RXD line (bidirectional communication line) is provided between the
そして更に本実施形態では、図9(C)に示すように、スレーブとなるミニモニタ部40が、マスタとなるメインモニタ部62からデータを受信したことを条件に、その受信データに対応する処理を行い、その受信データに対応する応答データをメインモニタ部62に送信する。即ち、メインモニタ部62がデータ(コマンド)をミニモニタ部40に送信すると、ウェイト状態となっていたミニモニタ部40がこれを受信し、その受信データに対応する処理を行う。そして、その受信データに対応するデータ(リプライ)をメインモニタ部62に送信する。その後、ミニモニタ部40は、メインモニタ部62からデータを受信するまでウェイト状態になる。即ちミニモニタ部40は、メインモニタ部62からデータを受信するまで動作を停止し、データを受信したことを条件に動作を開始する。このようにすることで、ミニモニタ部40とメインモニタ部62との間の通信ラインを1本にしながら、データを適正に送受信できるようになる。
Further, in the present embodiment, as shown in FIG. 9C, the processing corresponding to the received data is performed on condition that the
さて、図9(A)の通信手法は、TXDとRXDが別ラインになっているため、図9(B)に比べてデータを高速に通信できるという利点がある。また、ミニモニタ部40、メインモニタ部62の一方で通信エラーが発生した場合に、即座にエラーメッセージを他方に返すことができるという利点もある。例えば、ミニモニタ部40で通信エラーが発生した場合には、RXDでのデータ受信の終了を待つことなくTXDを使用して即座にエラーメッセージをメインモニタ部62に返すことができる。
The communication method of FIG. 9A has an advantage that data can be communicated at higher speed than FIG. 9B because TXD and RXD are on separate lines. There is also an advantage that when a communication error occurs in one of the
一方、本実施形態では後述するように、ミニモニタ部40とメインモニタ部62とでBCLKを共有させている。これにより後述するように、最適な速度で高速にデータを通信できるようになる。したがって、図9(A)のような通信ラインを2本設ける構成にせずに、図9(B)のように通信ラインを1本だけ設ける構成にしても、問題なくデバッグデータを高速に送受信できるようになる。
On the other hand, in the present embodiment, the BCLK is shared by the
また、本実施形態では後述するように、送受信データは固定長でありデータ長が短い(例えば14バイト)。したがって、例えばミニモニタ部40で通信エラーが発生した場合、受信処理の終了を待ってからエラーメッセージを送信しても、時間的な遅れはそれほど大きくならない。また、送受信データのデータ長が短いため、通信エラーの発生自体も最小限に抑えることができる。
In this embodiment, as will be described later, transmission / reception data has a fixed length and a short data length (for example, 14 bytes). Therefore, for example, when a communication error occurs in the
このように本実施形態では、デバッグデータの通信ラインを1本だけ設ける構成にすることでマイクロコンピュータの端子数を減らすという利益を得ている。そしてこの利益を得るために生じる不利益(通信速度の低下、エラーメッセージの遅延)を、BCLKを共有化したり送受信データを固定長の短いデータにすることで解消している。 As described above, the present embodiment has an advantage of reducing the number of terminals of the microcomputer by providing only one debug data communication line. Disadvantages (decrease in communication speed, error message delay) that occur in order to obtain this benefit are eliminated by sharing BCLK or making transmission / reception data short data of a fixed length.
7.送受信データのフォーマット及び種類
図10(A)に、TXD/RXDのラインで送受信されるデータのフォーマット例を示す。送受信データは、1バイトのID(コマンド識別データ)、1バイトのデータサイズ、4バイトのアドレス、4バイトのデータ1、4バイトのデータ2から成る14バイトの固定長データになっている。
7). Format and Type of Transmission / Reception Data FIG. 10A shows a format example of data transmitted / received through the TXD / RXD line. The transmission / reception data is 14-byte fixed length data composed of 1-byte ID (command identification data), 1-byte data size, 4-byte address, 4-
図10(B)に示すように、メインモニタ部62がミニモニタ部40にGOコマンドの実行を指示する場合、ミニモニタ部40が受信するデータのIDには、GOコマンドの識別データである00hが設定される。そしてこの場合には、ミニモニタ部40は、メインモニタ部62にデータを送信しない。
As shown in FIG. 10B, when the
図10(C)に示すように、メインモニタ部62がライトコマンドの実行を指示する場合、ミニモニタ部40の受信データのIDには、ライトコマンドの識別データである01hが設定される。また受信データのアドレス、データ1、データ2には、各々、ライトアドレス、ライトデータ1、ライトデータ2が設定される。そして、ミニモニタ部40の送信データのデータ1には01hが設定される。
As shown in FIG. 10C, when the
なお、ライトコマンドを、バイトデータのライトコマンド、ハーフワードデータのライトコマンド、ワードデータのライトコマンド、ダブルワードデータのライトコマンドというように、ライトするデータの長さに応じて複数種類用意するようにしてもよい。このようにした場合には、各々のライトコマンドに対して異なったIDを割り振ることになる。 A plurality of types of write commands, such as a byte data write command, a half word data write command, a word data write command, and a double word data write command, are prepared according to the length of data to be written. May be. In this case, a different ID is assigned to each write command.
図10(D)に示すように、メインモニタ部62がリードコマンドの実行を指示する場合、ミニモニタ部40の受信データのIDには、リードコマンドの識別データである02hが設定される。また受信データのアドレスにはリードアドレスが設定される。そして、ミニモニタ部40の送信データのデータ1、データ2には、各々、リードコマンド処理で得られたリードデータ1、リードデータ2が設定される。
As shown in FIG. 10D, when the
さて、本実施形態では、ミニモニタ部62が実行するプリミティブコマンドとして、GO、ライト、リードコマンド以外にも、外部ルーチンジャンプ、データフィルなどのコマンドを用意している。
In the present embodiment, commands such as an external routine jump and data fill are prepared as primitive commands to be executed by the
ここで外部ルーチンジャンプコマンドは、外部ルーチンにジャンプすることを指示するコマンドである。このような外部ルーチンジャンプコマンドを用いることで、例えばフラッシュメモリ(EEPROM)の初期化プログラムや書き込みプログラムのルーチンへのジャンプが可能になる。そして図11(A)に示すように、メインモニタ部62が外部ルーチンジャンプコマンドの実行を指示する場合、ミニモニタ部40の受信データのIDには、外部ルーチンジャンプコマンドの識別データである03hが設定される。また受信データのデータサイズ、アドレス、データ1、データ2には、各々、18h(誤動作防止チェック)、%R12(ルーチンアドレス)、%R13(ライトデータ)、%R14(データアドレス)が設定される。そして、ミニモニタ部40の送信データのデータ1には、%R10(戻り値。戻り値が0の場合に正常終了)が設定される。
Here, the external routine jump command is a command for instructing to jump to the external routine. By using such an external routine jump command, for example, it is possible to jump to a routine of an initialization program or a writing program of a flash memory (EEPROM). As shown in FIG. 11A, when the
またデータフィルコマンドは、メモリを所与の値(例えば0)でフィルするためのコマンドである。例えば大容量のメモリの全てのビットを0の値に設定する場合、ライトコマンドを用いたのでは処理時間が非常に長くなる。このような場合、データフィルコマンドが有効になる。そして図11(B)に示すように、メインモニタ部62がデータフィルコマンドの実行を指示する場合、ミニモニタ部40の受信データのIDには、データフィルコマンドの識別データである04hが設定される。また受信データのデータサイズ、アドレス、データ1、データ2には、各々、データサイズである1、2又は4、スタートアドレス、フィル回数、フィルパターンが設定される。
The data fill command is a command for filling the memory with a given value (for example, 0). For example, when all bits of a large-capacity memory are set to a value of 0, the processing time becomes very long if a write command is used. In such a case, the data fill command becomes valid. As shown in FIG. 11B, when the
このように本実施形態では、メインモニタ部62からの受信データに、ミニモニタ部40が実行するプリミティブコマンドの識別データIDを含ませている。このようにすることで、プリミティブコマンドの実行の指示を簡易にミニモニタ部40に伝えることが可能になる。
As described above, in this embodiment, the reception data from the
8.固定長の送受信データ
本実施形態では図10(A)に示すように、ミニモニタ部40、メインモニタ部62間の送受信データを14バイトの固定長のデータにしている。このようにすることで、ミニモニタプログラムの命令コードサイズを更に小さくすることが可能になる。
8). In this embodiment, as shown in FIG. 10A, the transmission / reception data between the
即ち送受信データを可変長にすると、図12(A)のE1、E2、E3に示す処理部分(命令列)が、ほとんど全てのコマンドについて必要になる。これらのE1、E2、E3の処理部分は、どれだけのデータ数の処理が必要かを判断する部分である。即ち可変長データを処理する場合には、送受信データに含まれるデータサイズに基づいて、処理すべきデータの数を調べる必要がある。そして、そのデータ数を、例えばワーク領域であるRAM上に保持しておいて、1つのデータの処理が終了する毎にこのデータ数をデクリメントしたり、データ数が0になったか否かを判断したりする処理が必要になる。このため、図12(A)に示すように、ミニモニタプログラムのソースコードのサイズが大きくなる。 That is, when the transmission / reception data is variable length, the processing parts (instruction sequences) indicated by E1, E2, and E3 in FIG. 12A are necessary for almost all commands. These processing parts E1, E2, and E3 are parts for determining how many data processes are necessary. That is, when processing variable-length data, it is necessary to check the number of data to be processed based on the data size included in the transmission / reception data. Then, the number of data is held on, for example, a RAM that is a work area, and each time processing of one data is finished, the number of data is decremented or it is determined whether or not the number of data becomes zero. Processing is required. For this reason, as shown in FIG. 12A, the size of the source code of the mini monitor program is increased.
これに対して、本実施形態では、送受信データを固定長にしている。このため、図12(A)と図12(B)を比較すればわかるように、ミニモニタプログラムのソースコードのサイズを可変長の場合に比べて例えば2/3程度にできる。これにより、図3のミニモニタROM42のサイズを更に小さくでき、小さなハードウェア規模でオンチップデバッグ機能を実現できるようになる。
On the other hand, in this embodiment, the transmission / reception data has a fixed length. For this reason, as can be seen by comparing FIG. 12A and FIG. 12B, the size of the source code of the mini monitor program can be reduced to, for example, about 2/3 as compared with the case of the variable length. Thereby, the size of the
なお、送受信データを固定長にすると通信効率が悪化するため、可変長にする場合に比べて通信速度が低下するという問題が生じる。そこで、本実施形態では後述するように、ミニモニタ部40とメインモニタ部62にBCLKを共有させている。これにより、最適な速度で高速にデータを通信できるようになり、上記の問題を解消できる。
Note that when the transmission / reception data is set to a fixed length, the communication efficiency is deteriorated, so that there is a problem that the communication speed is lowered as compared with the case where the length is variable. Therefore, in this embodiment, the BCLK is shared by the
9.ミニモニタROM
本実施形態では図3に示すように、マイクロコンピュータ20内にミニモニタROM42を設け、このミニモニタROM42にミニモニタプログラムを格納するようにしている。このようにすることで、ハードウェアの小規模化、マイクロコンピュータの低コスト化を図れるようになる。
9. Mini monitor ROM
In the present embodiment, as shown in FIG. 3, a
例えば図13(A)に示す構成では、マイクロコンピュータ330にローダロジック回路332及びRAM334を設ける。そして、このローダロジック回路332を用いて、JTAGインターフェース336を介して外部からRAM334にモニタプログラムをロードする。しかしながら、この構成では、ローダロジック回路332や、サイズがROMの5〜10倍程度になるRAM334をマイクロコンピュータ330内に設ける必要がある。このため、マイクロコンピュータ330の大規模化、高コスト化の問題を招く。
For example, in the configuration illustrated in FIG. 13A, a
これに対して、本実施形態では図13(B)に示すように、ミニモニタプログラムは、サイズがRAMの1/5〜1/10倍程度になるミニモニタROM42に格納される。またローダロジック回路も必要ない。したがって、図13(A)の構成に比べて、マイクロコンピュータ20の小規模化、低コスト化を図れるようになる。
On the other hand, in this embodiment, as shown in FIG. 13B, the mini monitor program is stored in the
また図13(A)の構成では、電源投入時又はリセット時に、CPUを一旦停止し、次にローダロジック回路332でモニタプログラムをRAM334にロードし、その後、CPUをデバッグモードで再スタートする必要がある。このため、処理が複雑化すると共に、デバッグモードのスタートに時間を要するようになってしまう。
In the configuration of FIG. 13A, it is necessary to stop the CPU once when power is turned on or reset, and then load the monitor program into the
これに対して、図13(B)の本実施形態では、RAMにミニモニタプログラムをロードする必要がない。このため、電源投入時又はリセット時に、CPUを一旦停止することなく、CPUのデバッグモードの動作をすぐにスタートできるようになる。 On the other hand, in the present embodiment shown in FIG. 13B, it is not necessary to load the mini monitor program into the RAM. For this reason, when the power is turned on or reset, the operation of the CPU in the debug mode can be started immediately without temporarily stopping the CPU.
10.BCLKの共有化
さて、マイクロコンピュータとデバッグツールとの間でのデータの通信方式としては、いわゆる同期式と呼ばれるものや調歩同期式と呼ばれるものを採用できる。そしてICEにおいては、マイクロコンピュータとデバッグツールとの間の通信ラインの本数をできる限り少なくすることが望まれる。更に通信データのサンプリングエラーをできる限り防止することも望まれる。
10. Sharing BCLK As a data communication method between the microcomputer and the debug tool, a so-called synchronous method or a so-called asynchronous method can be adopted. In ICE, it is desired to reduce the number of communication lines between the microcomputer and the debug tool as much as possible. It is also desirable to prevent communication data sampling errors as much as possible.
ところが同期式で通信を行う場合には、図14(A)に示すように、マイクロコンピュータ340(第1の情報処理装置)とデバッグツール342(第2の情報処理装置)との間に4本の通信ラインを設ける必要がある。即ち、送信データであるTXDのライン、TXDのサンプリングクロックであるTCLKのライン、受信データであるRXDのライン、RXDのサンプリングクロックであるRCLKのラインが必要になる。このため、通信ラインの本数が不要に増えてしまう。 However, when performing communication in a synchronous manner, as shown in FIG. 14A, there are four cables between the microcomputer 340 (first information processing apparatus) and the debug tool 342 (second information processing apparatus). It is necessary to provide a communication line. That is, a TXD line as transmission data, a TCLK line as TXD sampling clock, an RXD line as reception data, and an RCLK line as RXD sampling clock are required. This unnecessarily increases the number of communication lines.
一方、調歩同期式で通信を行う場合には、図14(B)に示すように、マイクロコンピュータ340とデバッグツール342は、別々にほぼ同一周波数のクロックを持つことになる。例えばマイクロコンピュータ340はクロックCLK1を持ち、デバッグシステム342はクロックCLK2を持ち、CLK1とCLK2の周波数をほぼ同一にする。そしてマイクロコンピュータ340は、図15(A)に示すように、CLK1を分周することでサンプリングクロックSMC1を生成し、調歩同期式で通信されるデータの各ビット(スタートビット、D0〜D7、ストップビット)を、このSMC1でサンプリングする。またデバッグツール342は、図15(B)に示すように、CLK2を分周することでサンプリングクロックSMC2を生成し、調歩同期式で通信されるデータの各ビット(ステートビット、D0〜D7、ストップビット)をこのSMC2でサンプリングする。
On the other hand, in the case of performing asynchronous communication, as shown in FIG. 14B, the
しかしながら、この調歩同期式では、マイクロコンピュータ340に含まれるCPUの動作周波数が高くなりCLK1及びCLK2の周波数が高くなると、SMC1及びSMC2の周波数も高くなり、通信データのサンプリングエラーが生じやすくなってしまう。逆に言えば、通信データのサンプリングエラーが生じない程度までしか、CLK1及びCLK2の周波数を高くできない。これは、マイクロコンピュータ340が高速動作する環境でのデバッグ作業ができないということを意味する。即ち、デバッグ作業時においては、マイクロコンピュータのクロック周波数を下げなければいけなくなる。
However, in this asynchronous system, when the operating frequency of the CPU included in the
このような問題を解決するために本実施形態では、図16に示すように、マイクロコンピュータ140とデバッグツール150とで、サンプリングクロックを生成するためのBCLKを共有させている。
In order to solve such a problem, in this embodiment, as shown in FIG. 16, the
より具体的には、マイクロコンピュータ140(第1の情報処理装置)は、通信部142(図3のSIO48に相当)を含む。そして通信部142は、送受信回路144(図6の送受信バッファ70、シフトレジスタ76及び送受信切替部78に相当)、分周回路146(図6の分周回路82に相当)を含む。この分周回路146は、図17(A)に示すように、BCLK(第1のクロック)を分周し、調歩同期式で送受信されるデータの各ビットをサンプリングするためのサンプリングクロックSMC1を生成する。そして、送受信回路144は、このSMC1に基づいてデータを送受信する。更にマイクロコンピュータ140は、BCLKをデバッグツール150に供給する。
More specifically, the microcomputer 140 (first information processing apparatus) includes a communication unit 142 (corresponding to the
デバッグツール150(第2の情報処理装置)は、通信部152を含む。そして通信部152は、送受信回路154(図7のCPU90、送受信切替部92に相当)、分周回路156(図7の分周回路96に相当)を含む。この分周回路156は、図17(B)に示すように、マイクロコンピュータ140から供給されたBCLKを分周し、サンプリングクロックSMC2を生成する。そして、送受信回路154は、このSMC2に基づいてデータを送受信する。
The debug tool 150 (second information processing apparatus) includes a
このように本実施形態では、調歩同期式でありながら、サンプリングクロックSMC1、SMC2を生成するためのBCLKをマイクロコンピュータ140とデバッグツール150とで共有する。これにより、通信データのサンプリングエラーの発生率を、図14(B)に示す一般的な調歩同期式通信に比べて格段に減少できる。また、図14(A)の同期式通信では、4本の通信ラインが必要であったが、本実施形態では図16に示すように2本の通信ラインで済む(全2重の場合には3本)。したがって、マイクロコンピュータ140とデバッグツール150との間の通信ラインの本数を、図14(A)に比べて少なくできる。この結果、マイクロコンピュータ140の端子数を減らすことが可能になり、マイクロコンピュータ140の低コスト化を図れるようになる。
As described above, in this embodiment, the
特に、図14(B)の構成では、CLK1(及びCLK2)の周波数が高くなればなるほど、通信データのサンプリングエラーの発生率も高くなる。このため、デバッグ作業時においてマイクロコンピュータ340のクロック周波数を高くできず、マイクロコンピュータ340が高速動作する環境でのデバッグ作業ができなかった。
In particular, in the configuration of FIG. 14B, the higher the frequency of CLK1 (and CLK2), the higher the incidence of communication data sampling errors. For this reason, the clock frequency of the
これに対して、図16の本実施形態では、マイクロコンピュータ140もデバッグツール150もBCLKに基づいてサンプリングクロックを生成している。このため、BCLKの周波数が高くなっても、サンプリングエラーの発生率がそれほど高くならない。この結果、マイクロコンピュータ140が高速動作する環境でのデバッグ作業が可能になり、より実動作時に近い環境でのデバッグ作業が可能になる。
On the other hand, in this embodiment of FIG. 16, both the
更に本実施形態では、図18に示すように、通信部142に分周比制御部148(図6の制御レジスタ84に相当)を含ませると共に、通信部152に分周比制御部158(図7の制御レジスタ98に相当)、周波数検出回路159(図7の周波数検出回路95に相当)を含ませている。これにより、SMC1を生成する際の分周比FD1と、SMC2を生成する際の分周比FD2を可変に制御することが可能になる。この結果、BCLKの周波数が変化しても、最適で高速な通信速度でデータを通信することが可能になる。
Furthermore, in this embodiment, as shown in FIG. 18, the
即ち図19(A)に示すようにBCLKの周波数が低くなった場合には、図17(A)、(B)で16であった分周比FD1、FD2が例えば8に変更される。これにより、サンプリングクロックSMC1、SMC2は、BCLKを16分周したクロックから8分周したクロックに変更される。この結果、1ビットのデータに対応するBCLKのクロック数が、16であったものが(16クロックモード)、8に変更される(8クロックモード)。 That is, as shown in FIG. 19A, when the frequency of BCLK is lowered, the frequency division ratios FD1 and FD2 that were 16 in FIGS. 17A and 17B are changed to 8, for example. As a result, the sampling clocks SMC1 and SMC2 are changed from a clock obtained by dividing BCLK by 16 to a clock obtained by dividing the clock by eight. As a result, the clock number of BCLK corresponding to 1-bit data is changed from 16 (16 clock mode) to 8 (8 clock mode).
また図19(B)に示すようにBCLKの周波数が更に低くなった場合には、図19(A)で8であった分周比FD1、FD2が例えば4に変更される。これにより、サンプリングクロックSMC1、SMC2は、BCLKを8分周したクロックから4分周したクロックに変更される。この結果、1ビットのデータに対応するBCLKのクロック数が、8であったものが(8クロックモード)、4になるように変更される(4クロックモード)。 Further, as shown in FIG. 19B, when the frequency of BCLK is further lowered, the frequency division ratios FD1 and FD2 that were 8 in FIG. As a result, the sampling clocks SMC1 and SMC2 are changed from a clock obtained by dividing BCLK by 8 to a clock obtained by dividing the clock by four. As a result, the BCLK clock number corresponding to 1-bit data is changed from 8 (8 clock mode) to 4 (4 clock mode).
このようにすることで、BCLKの周波数が低くなった場合にも、データの通信速度は結局低くならなくなる。この結果、最適で高速な通信速度でデータを通信することが可能になる。 In this way, even when the BCLK frequency is lowered, the data communication speed is not lowered. As a result, data can be communicated at an optimum and high communication speed.
特に、マイクロコンピュータのクロック周波数は、マイクロコンピュータを使用するユーザ毎に異なったものになるのが一般的である。即ち、あるユーザは60MHZのクロックでマイクロコンピュータを動作させ、別のユーザは20MHZのクロックでマイクロコンピュータを動作させる。 In particular, the clock frequency of the microcomputer is generally different for each user who uses the microcomputer. That is, one user operates the microcomputer with a clock of 60 MHZ, and another user operates the microcomputer with a clock of 20 MHZ.
しかしながら、図14(A)、(B)の通信方式では、マイクロコンピュータのクロック周波数が変化すると、データの通信速度も変化してしまう。即ち、クロック周波数が低くなるとデータの通信速度も低くなってしまう。したがって、最大限の通信速度でデータを通信することができなくなる。 However, in the communication systems shown in FIGS. 14A and 14B, when the clock frequency of the microcomputer changes, the data communication speed also changes. That is, when the clock frequency is lowered, the data communication speed is also lowered. Therefore, data cannot be communicated at the maximum communication speed.
これに対して、本実施形態では、マイクロコンピュータのクロック周波数が、マイクロコンピュータを使用するユーザに応じて変化すると、分周比FD1、FD2も変化し、1ビットのデータに対応するクロック数も変化する。即ちクロック周波数が低くなると、分周比FD1、FD2も小さくなり、1ビットのデータに対応するクロック数も少なくなる。この結果、通信速度は結局低くならず、最適で高速な通信速度で通信を行えるようになる。即ち、多様な周波数のクロックを使用するユーザに応じて、最適な通信速度で通信を行えるようになる。 On the other hand, in this embodiment, when the clock frequency of the microcomputer changes according to the user who uses the microcomputer, the frequency division ratios FD1 and FD2 also change, and the number of clocks corresponding to 1-bit data also changes. To do. That is, when the clock frequency is lowered, the frequency division ratios FD1 and FD2 are also reduced, and the number of clocks corresponding to 1-bit data is also reduced. As a result, the communication speed is not lowered after all, and communication can be performed at an optimal and high communication speed. That is, communication can be performed at an optimum communication speed according to a user who uses clocks having various frequencies.
次に、通信部142、152での処理について図20、図21のフローチャートを用いて更に詳細に説明する。
Next, processing in the
図20に示すように、まず、図18の通信部152内の周波数検出回路159が、マイクロコンピュータ140から供給されるBCLKの周波数を検出する(ステップV1)。そして、BCLKの周波数が30MHZ以上であるか否かを判断し(ステップV2)、30MHZ以上である場合には、分周比制御部158が分周比FD2を16に設定する(ステップV3)。そして、FD2が16であることを知らせる分周比データを、送受信回路154を介してマイクロコンピュータ140に送信する(ステップV4)。次に、分周回路156がFD2=16でBCLKを分周しSMC2を生成する(ステップV5)。そして、以降は、このSMC2によりデータの送受信を行う。
As shown in FIG. 20, first, the
BCLKの周波数が30MHZより低い場合には、周波数が15MHZ以上か否かを判断する(ステップV6)。そして、周波数が15MHZ以上である場合にはFD2=8に設定し(ステップV7)、ステップV4、V5と同様の処理を行う(ステップV8、V9)。また、BCLKの周波数が15MHZより低い場合にはFD2=4に設定し(ステップV10)、ステップV4、V5と同様の処理を行う(ステップV11、V12)。 When the frequency of BCLK is lower than 30 MHZ, it is determined whether or not the frequency is 15 MHZ or higher (step V6). If the frequency is 15 MHZ or higher, FD2 = 8 is set (step V7), and processing similar to steps V4 and V5 is performed (steps V8 and V9). If the frequency of BCLK is lower than 15 MHZ, FD2 = 4 is set (step V10), and the same processing as steps V4 and V5 is performed (steps V11 and V12).
一方、マイクロコンピュータ140側では図21のフローチャートに示すような処理を行う。即ち、まず、デバッグツール150から送受信回路144を介して分周比データを受信する(ステップW1)。次に、受信した分周比データに基づいて分周比制御部148が分周比FD1を決定する(ステップW2)。そして、分周回路146は、このFD1でBCLKを分周しSMC1を生成する。そして、以降は、このSMC1でデータの送受信を行う。
On the other hand, the
11.ミニモニタ部の詳細な処理例
次にミニモニタ部の詳細な処理例について説明する。
11. Detailed Processing Example of Mini Monitor Unit Next, a detailed processing example of the mini monitor unit will be described.
図22に示すように、ユーザプログラムの実行中にブレークが発生すると、ミニモニタプログラムの処理がスタートし、ユーザプログラム実行モードからデバッグモードに移行する。そして、ミニモニタプログラムが所与のコマンド処理を行いリターン命令を実行すると、デバッグモードからユーザプログラム実行モードに戻る。 As shown in FIG. 22, when a break occurs during execution of the user program, processing of the mini monitor program starts and shifts from the user program execution mode to the debug mode. When the mini monitor program executes a given command process and executes a return instruction, the program returns from the debug mode to the user program execution mode.
図23、図24に、デバッグモードでのミニモニタプログラムの処理を表すフローチャートを示す。 23 and 24 are flowcharts showing the processing of the mini monitor program in the debug mode.
デバッグモードに移行すると、ミニモニタプログラムは、まず、図3のCPU22の内部レジスタ24の内容をミニモニタRAM44に退避する(ステップS1)。そして、ミニモニタプログラムが使用する制御レジスタ46の設定処理を行う(ステップS2)。
When shifting to the debug mode, the mini-monitor program first saves the contents of the
次に、デバッグツール60から受信した14バイトのデータ(図10(A)参照)を、受信バッファ74(図6参照)にライトする(ステップS3)。そして、受信バッファ74のデータの先頭の1バイト(コマンド識別データID)をチェックする(ステップS4)。
Next, the 14-byte data (see FIG. 10A) received from the
そして図24に示すように、IDがリードコマンドを示すものであった場合には(図10(D)参照)、受信バッファ74からリードアドレスを取得する(ステップS5、S6)。そして、取得したリードアドレスからデータをリードし、送信バッファ72にライトする(ステップS7)。次に、送信バッファ72のデータをデバッグツール60に送信する(ステップS8)。そして、図23のステップS3に戻り、次の受信データを受信バッファ74にライトする。 As shown in FIG. 24, when the ID indicates a read command (see FIG. 10D), a read address is acquired from the reception buffer 74 (steps S5 and S6). Then, data is read from the acquired read address and written to the transmission buffer 72 (step S7). Next, the data in the transmission buffer 72 is transmitted to the debug tool 60 (step S8). Then, the process returns to step S 3 in FIG. 23, and the next received data is written to the receiving buffer 74.
IDがライトコマンドを示すものであった場合には(図10(C)参照)、受信バッファ74からライトアドレスを取得する(ステップS9、S10)。そして、受信バッファ74からライトデータを取得し、ステップS10で取得したライトアドレスにライトする(ステップS11)。 If the ID indicates a write command (see FIG. 10C), the write address is acquired from the reception buffer 74 (steps S9 and S10). Then, write data is acquired from the reception buffer 74 and written to the write address acquired in step S10 (step S11).
IDが外部ルーチンジャンプコマンドを示すものであった場合には(図11(A)参照)、受信バッファ74からルーチンアドレスを取得する(ステップS12、S13)。そして、外部ルーチンにジャンプ後、ミニモニタプログラムにリターンする(ステップS14)。 If the ID indicates an external routine jump command (see FIG. 11A), the routine address is acquired from the reception buffer 74 (steps S12 and S13). Then, after jumping to the external routine, the process returns to the mini monitor program (step S14).
IDがGOコマンドを示すものであった場合には(図11(B)参照)、ミニモニタRAM44に退避したデータを内部レジスタ24にリストアする(ステップS15、S16)。そして、図22に示すようにユーザプログラムにリターンし、デバッグモードから抜ける(ステップS17)。
If the ID indicates a GO command (see FIG. 11B), the data saved in the
一方、IDがリード、ライト、外部ルーチンジャンプ、GOコマンドのいずれでもなかった場合には、処理が必要ないと判断する(ステップS15、S18)。そして送信バッファ72にダミーのデータをライトする(ステップS19)。なお、図24では、データフィルコマンドの処理については省略している。 On the other hand, if the ID is not any of read, write, external routine jump, and GO command, it is determined that no processing is required (steps S15 and S18). Then, dummy data is written to the transmission buffer 72 (step S19). In FIG. 24, processing of the data fill command is omitted.
以上のようにして、デバッグコマンドを変換することで得られたプリミティブコマンドが、ミニモニタプログラムにより実行されることになる。 As described above, the primitive command obtained by converting the debug command is executed by the mini monitor program.
12.電子機器
次に、以上の本実施形態のマイクロコンピュータを含む電子機器に関して説明する。
12 Next, an electronic device including the microcomputer according to the present embodiment will be described.
例えば図25(A)に電子機器の1つであるカーナビゲーションシステムの内部ブロック図を示し、図26(A)にその外観図を示す。カーナビゲーションシステムの操作はリモコン510を用いて行われ、GPSやジャイロからの情報に基づいて位置検出部520が車の位置を検出する。地図などの情報はCDROM530(情報記憶媒体)に格納されている。画像メモリ540は画像処理の際の作業領域になるメモリであり、生成された画像は画像出力部550を用いて運転者に表示される。マイクロコンピュータ500は、リモコン510、位置検出部520、CDROM530などのデータ入力源からデータを入力し、種々の処理を行い、処理後のデータを画像出力部550などの出力装置を用いて出力する。
For example, FIG. 25A shows an internal block diagram of a car navigation system which is one of electronic devices, and FIG. 26A shows an external view thereof. The operation of the car navigation system is performed using the
図25(B)に電子機器の1つであるゲーム装置の内部ブロック図を示し、図26(B)にその外観図を示す。このゲーム装置では、ゲームコントローラ560からのプレーヤの操作情報、CDROM570からのゲームプログラム、ICカード580からのプレーヤ情報等に基づいて、画像メモリ590を作業領域としてゲーム画像やゲーム音を生成し、画像出力部610、音出力部600を用いて出力する。
FIG. 25B shows an internal block diagram of a game device which is one of electronic devices, and FIG. 26B shows an external view thereof. In this game apparatus, based on the operation information of the player from the
図25(C)に電子機器の1つであるプリンタの内部ブロック図を示し、図26(C)にその外観図を示す。このプリンタでは、操作パネル620からの操作情報、コードメモリ630及びフォントメモリ640から文字情報に基づいて、ビットマップメモリ650を作業領域として、印刷画像を生成し、プリント出力部660を用いて出力する。またプリンタの状態やモードを表示パネル670を用いてユーザに伝える。
FIG. 25C shows an internal block diagram of a printer which is one of electronic devices, and FIG. 26C shows an external view thereof. In this printer, based on the operation information from the
本実施形態のマイクロコンピュータ又はデバッグシステムによれば、図25(A)〜図26(C)の電子機器を動作させるユーザプログラムの開発の容易化、開発期間の短縮化を図れるようになる。またマイクロコンピュータが実動作する環境と同じ環境で、ユーザプログラムのデバッグ作業を行うことができるため、電子機器の信頼性を高めることができる。また電子機器に組み込まれるマイクロコンピュータのハードウェアを小規模化、低コスト化できるため、電子機器の低コスト化も図れるようになる。更にミニモニタプログラムの命令コードサイズは小さいため、ユーザがプログラムや各種データの格納に使用するメモリ領域を最大限に確保でき、場合によれば、ユーザーが使用する該メモリ領域を全く使用せずにモニタプログラムを載せることができる。 According to the microcomputer or the debugging system of the present embodiment, it becomes possible to facilitate the development of a user program for operating the electronic devices of FIGS. 25A to 26C and shorten the development period. In addition, since the user program can be debugged in the same environment as the environment in which the microcomputer actually operates, the reliability of the electronic device can be improved. Further, since the hardware of the microcomputer incorporated in the electronic device can be reduced in size and cost, the cost of the electronic device can be reduced. Furthermore, since the instruction code size of the mini-monitor program is small, the user can secure the maximum memory area for storing programs and various data. In some cases, the memory area used by the user is not used at all. A monitor program can be loaded.
なお本実施形態のマイクロコンピュータを適用できる電子機器としては、上記以外にも例えば、携帯電話(セルラーフォン)、PHS、ページャ、オーディオ機器、電子手帳、電子卓上計算機、POS端末、タッチパネルを備えた装置、プロジェクタ、ワードプロセッサ、パーソナルコンピュータ、テレビ、ビューファインダ型又はモニタ直視型のビデオテープレコーダなど種々のものを考えることができる。 In addition to the above, the electronic apparatus to which the microcomputer of the present embodiment can be applied includes, for example, a mobile phone (cellular phone), a PHS, a pager, an audio device, an electronic notebook, an electronic desk calculator, a POS terminal, and a touch panel. Various devices such as a projector, a word processor, a personal computer, a television, a viewfinder type or a monitor direct-view type video tape recorder can be considered.
なお、本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。 In addition, this invention is not limited to this embodiment, A various deformation | transformation implementation is possible within the range of the summary of this invention.
例えば本発明のプリミティブコマンドとしては、本実施形態で説明したものが特に望ましいが、これに限定されるものではない。 For example, as the primitive commands of the present invention, those described in this embodiment are particularly desirable, but the present invention is not limited to these.
またマイクロコンピュータやミニモニタ部(第1のモニタ手段)の構成も本実施形態で説明したものに限定されず、種々の変形実施が可能である。 Further, the configuration of the microcomputer and the mini-monitor unit (first monitor means) is not limited to that described in the present embodiment, and various modifications can be made.
またデバッグシステムの構成も図7に示すものに限られるものではない。 Further, the configuration of the debug system is not limited to that shown in FIG.
10 マイクロコンピュータ、12 CPU(中央処理ユニット)、14 ミニモニタ部(第1のモニタ手段)、16 メインモニタ部(第2のモニタ手段)、20 マイクロコンピュータ、22 CPU(中央処理ユニット)、24 内部レジスタ、26 BCU(バス制御ユニット)、28 内部メモリ、30 クロック生成部、31 バス、32 バス、33 外部バス、34 内部バス、36 外部メモリ、40 ミニモニタ部(第1のモニタ手段)、42 ミニモニタROM、44 ミニモニタRAM、46 制御レジスタ、48 SIO、50 トレース部、60 デバッグツール、62 メインモニタ部(第2のモニタ手段)、66 ホストシステム、70 送受信バッファ、72 送信バッファ、74 受信バッファ、76 シフトレジスタ、78 送受信切替部、80 クロック制御部、82 分周回路、84 制御レジスタ、90 CPU、92 送受信切替部、94 クロック制御部、95 周波数検出部、96 分周回路、98 制御レジスタ、100 アドレスアップカウンタ、102 セレクタ、104 トレースメモリ、106 セレクタ、108 ROM、110 メインモニタROM、112 RAM、114 RS232Cインターフェース、116 パラレルインターフェース、118 クロック生成部、140 マイクロコンピュータ(第1の情報処理装置)、142 通信部、144 送受信回路、146 分周回路、148 分周比制御部、150 デバッグツール(第2の情報処理装置)、152 通信部、154 送受信回路、156 分周回路、158 分周比制御部、159 周波数検出回路 10 microcomputer, 12 CPU (central processing unit), 14 mini monitor section (first monitoring means), 16 main monitor section (second monitoring means), 20 microcomputer, 22 CPU (central processing unit), 24 internal register , 26 BCU (bus control unit), 28 internal memory, 30 clock generation unit, 31 bus, 32 bus, 33 external bus, 34 internal bus, 36 external memory, 40 mini monitor unit (first monitor means), 42 mini monitor ROM , 44 Mini monitor RAM, 46 Control register, 48 SIO, 50 Trace unit, 60 Debug tool, 62 Main monitor unit (second monitor means), 66 Host system, 70 Transmit / receive buffer, 72 Transmit buffer, 74 Receive buffer, 76 Shift register, 8 transmission / reception switching unit, 80 clock control unit, 82 frequency dividing circuit, 84 control register, 90 CPU, 92 transmission / reception switching unit, 94 clock control unit, 95 frequency detection unit, 96 frequency dividing circuit, 98 control register, 100 address up counter , 102 selector, 104 trace memory, 106 selector, 108 ROM, 110 main monitor ROM, 112 RAM, 114 RS232C interface, 116 parallel interface, 118 clock generation unit, 140 microcomputer (first information processing apparatus), 142 communication unit 144 transmission / reception circuit, 146 frequency division circuit, 148 frequency division ratio control unit, 150 debug tool (second information processing device), 152 communication unit, 154 transmission / reception circuit, 156 frequency division circuit, 158 frequency division ratio control unit, 159 Frequency detection circuit
Claims (13)
命令の実行処理を行う中央処理ユニットと、
マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含み、
前記第1のモニタ手段は、
前記第1のモニタ手段の処理を実行するためのモニタプログラムが格納されるモニタROMを含み、
前記モニタプログラムは、
前記プリミティブコマンドの命令コードを含み、
前記第2のモニタ手段からの前記受信データは、
前記プリミティブコマンドを識別するための識別データを含み、
前記第1のモニタ手段は、
前記第2のモニタ手段から前記受信データを受信した場合に、前記受信データに含まれる前記識別データにより指定される命令コードのプリミティブコマンドを実行することを特徴とするマイクロコンピュータ。 A microcomputer having an on-chip debugging function,
A central processing unit for executing instructions,
Data is transmitted to and received from the second monitor means that is provided outside the microcomputer and performs processing for converting a debug command into at least one primitive command, and a primitive command to be executed is sent from the second monitor means. First monitoring means for determining based on received data and performing processing for executing the determined primitive command;
The first monitoring means includes
A monitor ROM for storing a monitor program for executing the processing of the first monitor means;
The monitor program is
Including an instruction code of the primitive command;
The received data from the second monitor means is
Including identification data for identifying the primitive command;
The first monitoring means includes
A microcomputer that executes a primitive command of an instruction code specified by the identification data included in the received data when the received data is received from the second monitor means.
命令の実行処理を行う中央処理ユニットと、
マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、
前記中央処理ユニットの命令実行処理に使用され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられる制御レジスタとを含み、
前記第2のモニタ手段は、
前記デバッグコマンドであるステップ実行コマンドを、ステップ実行イネーブルビットへのライトコマンドである第1のプリミティブコマンドと、GOコマンドである第2のプリミティブコマンドに変換し、
前記第1のモニタ手段は、
前記第1、第2のプリミティブコマンドを実行することで、ステップ実行処理を行うことを特徴とするマイクロコンピュータ。 A microcomputer having an on-chip debugging function,
A central processing unit for executing instructions,
Data is transmitted to and received from the second monitor means that is provided outside the microcomputer and performs processing for converting a debug command into at least one primitive command, and a primitive command to be executed is sent from the second monitor means. First monitoring means for performing a process for executing the determined primitive command, based on the received data;
A control register that is used for instruction execution processing of the central processing unit and whose address is allocated on a memory map in debug mode;
The second monitor means includes
The step execution command which is the debug command is converted into a first primitive command which is a write command to a step execution enable bit and a second primitive command which is a GO command.
The first monitoring means includes
A microcomputer performing step execution processing by executing the first and second primitive commands.
命令の実行処理を行う中央処理ユニットと、
マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、
前記第2のモニタ手段からの前記受信データを一時的に蓄えるための受信バッファと、
前記第2のモニタ手段への送信データを一時的に蓄えるための送信バッファとを含み、
前記第2のモニタ手段からの前記受信データは、
前記プリミティブコマンドを識別するための識別データを含み、
前記第1のモニタ手段は、
前記受信データの識別データがリードコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからリードアドレスを取得し、取得した前記リードアドレスからデータをリードし、リードした前記データを前記送信バッファにライトし、
前記受信データの識別データがライトコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからライトアドレスとライトデータを取得し、取得した前記ライトアドレスに、取得した前記ライトデータを書き込む処理を行うことを特徴とするマイクロコンピュータ。 A microcomputer having an on-chip debugging function,
A central processing unit for executing instructions,
Data is transmitted to and received from the second monitor means that is provided outside the microcomputer and performs processing for converting a debug command into at least one primitive command, and a primitive command to be executed is sent from the second monitor means. First monitoring means for performing a process for executing the determined primitive command, based on the received data;
A reception buffer for temporarily storing the reception data from the second monitoring means;
A transmission buffer for temporarily storing transmission data to the second monitoring means,
The received data from the second monitor means is
Including identification data for identifying the primitive command;
The first monitoring means includes
When the identification data of the received data indicates a primitive command of a read command, a read address is acquired from the received data of the reception buffer, data is read from the acquired read address, and the read Write data to the transmit buffer;
If the identification data of the received data indicates a primitive command of a write command, a write address and write data are acquired from the received data in the reception buffer, and the acquired write address is acquired at the acquired write address. A microcomputer that performs a process of writing data.
前記第1のモニタ手段は、
受信した識別データが外部ルーチンジャンプコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからルーチンアドレスを取得して外部ルーチンにジャンプし、ジャンプ後に前記第1のモニタ手段の処理にリターンする処理を行うことを特徴とするマイクロコンピュータ。 In claim 3,
The first monitoring means includes
If the received identification data indicates a primitive command of an external routine jump command, a routine address is acquired from the received data in the reception buffer and jumped to an external routine. After the jump, the first monitoring means A microcomputer characterized by performing a process returning to the process.
前記中央処理ユニットの内部レジスタの内容が退避され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられるモニタRAMを含み、
前記第1のモニタ手段は、
受信した識別データがGOコマンドのプリミティブコマンドを示すものであった場合には、前記モニタRAMに退避したデータを前記内部レジスタにリストアし、リストア後にユーザプログラムの処理にリターンする処理を行うことを特徴とするマイクロコンピュータ。 In claim 3 or 4,
Including a monitor RAM in which the contents of the internal register of the central processing unit are saved and the address is assigned on the memory map in the debug mode;
The first monitoring means includes
When the received identification data indicates a GO command primitive command, the data saved in the monitor RAM is restored to the internal register, and the process of returning to the process of the user program after the restoration is performed. A microcomputer.
前記プリミティブコマンドは、
ユーザプログラムの実行を開始するコマンド、デバッグモード時におけるメモリマップ上のアドレスにデータをライトするコマンド、及び前記メモリマップ上のアドレスからデータをリードするコマンドを含むことを特徴とするマイクロコンピュータ。 In any one of Claims 1 thru | or 5,
The primitive command is
A microcomputer comprising: a command for starting execution of a user program; a command for writing data to an address on a memory map in a debug mode; and a command for reading data from an address on the memory map.
前記第2のモニタ手段との間で半2重の双方向通信を行うための1本の双方向通信ラインが接続される端子を含み、
スレーブとなる前記第1のモニタ手段は、
マスタとなる前記第2のモニタ手段からデータを受信したことを条件に、該受信データに対応する処理を行い該受信データに対応する応答データを前記第2のモニタ手段に送信することを特徴とするマイクロコンピュータ。 In any one of Claims 1 thru | or 6.
A terminal to which one bidirectional communication line for performing half-duplex bidirectional communication with the second monitoring means is connected;
The first monitoring means to be a slave is
On the condition that data is received from the second monitor means serving as a master, processing corresponding to the received data is performed, and response data corresponding to the received data is transmitted to the second monitor means, A microcomputer.
前記第1のモニタ手段は、
前記第2のモニタ手段との間で固定長のデータを送受信することを特徴とするマイクロコンピュータ。 In any one of Claims 1 thru | or 7,
The first monitoring means includes
A microcomputer for transmitting and receiving fixed-length data to and from the second monitor means.
前記第1のモニタ手段がリード及びライト可能なモニタRAMを含み、
前記第1のモニタ手段は、
ユーザプログラムの実行がブレークしデバッグモードに移行した場合に、前記中央処理ユニットのプログラムカウンタ値及び内部レジスタの内容を前記モニタRAMに待避することを特徴とするマイクロコンピュータ。 In any one of Claims 1 thru | or 8.
The first monitor means includes a readable and writable monitor RAM;
The first monitoring means includes
A microcomputer characterized in that the program counter value of the central processing unit and the contents of an internal register are saved in the monitor RAM when execution of a user program breaks and shifts to a debug mode.
前記マイクロコンピュータの処理対象となるデータの入力源と、
前記マイクロコンピュータにより処理されたデータを出力するための出力装置とを含むことを特徴とする電子機器。 A microcomputer according to any one of claims 1 to 9;
An input source of data to be processed by the microcomputer;
And an output device for outputting data processed by the microcomputer.
ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、
前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含み、
前記第1のモニタ手段は、
前記第1のモニタ手段の処理を実行するためのモニタプログラムが格納されるモニタROMを含み、
前記モニタプログラムは、
前記プリミティブコマンドの命令コードを含み、
前記第2のモニタ手段からの前記受信データは、
前記プリミティブコマンドを識別するための識別データを含み、
前記第1のモニタ手段は、
前記第2のモニタ手段から前記受信データを受信した場合に、前記受信データに含まれる前記識別データにより指定される命令コードのプリミティブコマンドを実行することを特徴とする特徴とするデバッグシステム。 A debugging system for a target system including a microcomputer,
Second monitoring means for performing processing for converting a debug command issued by the host system into at least one primitive command;
Data is transmitted / received to / from the second monitoring means, a primitive command to be executed is determined based on the received data from the second monitoring means, and processing for executing the determined primitive command is performed. Monitoring means,
The first monitoring means includes
A monitor ROM for storing a monitor program for executing the processing of the first monitor means;
The monitor program is
Including an instruction code of the primitive command;
The received data from the second monitor means is
Including identification data for identifying the primitive command;
The first monitoring means includes
A debug system characterized by executing a primitive command of an instruction code specified by the identification data included in the received data when the received data is received from the second monitor means.
ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、
前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、
前記中央処理ユニットの命令実行処理に使用され、デバッグモード時におけるメモリマップ上にそのアドレスが割り付けられる制御レジスタとを含み、
前記第2のモニタ手段は、
前記デバッグコマンドであるステップ実行コマンドを、ステップ実行イネーブルビットへのライトコマンドである第1のプリミティブコマンドと、GOコマンドである第2のプリミティブコマンドに変換し、
前記第1のモニタ手段は、
前記第1、第2のプリミティブコマンドを実行することで、ステップ実行処理を行うことを特徴とするデバッグシステム。 A debugging system for a target system including a microcomputer,
Second monitoring means for performing processing for converting a debug command issued by the host system into at least one primitive command;
Data is transmitted / received to / from the second monitoring means, a primitive command to be executed is determined based on the received data from the second monitoring means, and processing for executing the determined primitive command is performed. Monitoring means,
A control register that is used for instruction execution processing of the central processing unit and whose address is allocated on a memory map in debug mode;
The second monitor means includes
The step execution command which is the debug command is converted into a first primitive command which is a write command to a step execution enable bit and a second primitive command which is a GO command.
The first monitoring means includes
A debug system that performs step execution processing by executing the first and second primitive commands.
ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、
前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、
前記第2のモニタ手段からの前記受信データを一時的に蓄えるための受信バッファと、
前記第2のモニタ手段への送信データを一時的に蓄えるための送信バッファとを含み、
前記第2のモニタ手段からの前記受信データは、
前記プリミティブコマンドを識別するための識別データを含み、
前記第1のモニタ手段は、
前記受信データの識別データがリードコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからリードアドレスを取得し、取得した前記リードアドレスからデータをリードし、リードした前記データを前記送信バッファにライトし、
前記受信データの識別データがライトコマンドのプリミティブコマンドを示すものであった場合には、前記受信バッファの前記受信データからライトアドレスとライトデータを取得し、取得した前記ライトアドレスに、取得した前記ライトデータを書き込む処理を行うことを特徴とするデバッグシステム。 A debugging system for a target system including a microcomputer,
Second monitoring means for performing processing for converting a debug command issued by the host system into at least one primitive command;
Data is transmitted / received to / from the second monitoring means, a primitive command to be executed is determined based on the received data from the second monitoring means, and processing for executing the determined primitive command is performed. Monitoring means,
A reception buffer for temporarily storing the reception data from the second monitoring means;
A transmission buffer for temporarily storing transmission data to the second monitoring means,
The received data from the second monitor means is
Including identification data for identifying the primitive command;
The first monitoring means includes
When the identification data of the received data indicates a primitive command of a read command, a read address is acquired from the received data of the reception buffer, data is read from the acquired read address, and the read Write data to the transmit buffer;
If the identification data of the received data indicates a primitive command of a write command, a write address and write data are acquired from the received data of the reception buffer, and the acquired write address is acquired at the acquired write address. A debugging system that performs a process of writing data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005091910A JP2005251217A (en) | 2005-03-28 | 2005-03-28 | Microcomputer, electronic equipment and debugging system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005091910A JP2005251217A (en) | 2005-03-28 | 2005-03-28 | Microcomputer, electronic equipment and debugging system |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP10372198A Division JP3684832B2 (en) | 1998-03-31 | 1998-03-31 | Microcomputer, electronic equipment and debugging system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005251217A true JP2005251217A (en) | 2005-09-15 |
Family
ID=35031565
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005091910A Pending JP2005251217A (en) | 2005-03-28 | 2005-03-28 | Microcomputer, electronic equipment and debugging system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005251217A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102008008711A1 (en) * | 2008-02-11 | 2009-08-13 | Atmel Germany Gmbh | Method for testing microcontroller, involves calling command for moving bit values of register of microcontroller as indirect jump address in test mode over interface |
DE102008008709A1 (en) * | 2008-02-11 | 2009-08-13 | Atmel Germany Gmbh | Microcontroller, has computing unit whose address output is connected with parallel input of shift register, where series input and output of shift register are connected with connection of microcontroller and computing unit, respectively |
-
2005
- 2005-03-28 JP JP2005091910A patent/JP2005251217A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102008008711A1 (en) * | 2008-02-11 | 2009-08-13 | Atmel Germany Gmbh | Method for testing microcontroller, involves calling command for moving bit values of register of microcontroller as indirect jump address in test mode over interface |
DE102008008709A1 (en) * | 2008-02-11 | 2009-08-13 | Atmel Germany Gmbh | Microcontroller, has computing unit whose address output is connected with parallel input of shift register, where series input and output of shift register are connected with connection of microcontroller and computing unit, respectively |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3684832B2 (en) | Microcomputer, electronic equipment and debugging system | |
US6922795B2 (en) | Microcomputer, electronic equipment, and debugging system | |
US7233541B2 (en) | Storage device | |
JP3671667B2 (en) | Microcomputer, electronic equipment and debugging system | |
US9213615B2 (en) | Information processing apparatus with debugging unit and debugging method therefor | |
CN112559410A (en) | FPGA-based LIO bus extension UART peripheral system and method | |
JP3666237B2 (en) | Information processing apparatus and electronic apparatus | |
JPH10116187A (en) | Microcomputer | |
US7921334B2 (en) | Program and method for error determination, and electronic apparatus | |
JP2000276370A (en) | Microcomputer, electronic device and emulation method | |
JP2005251217A (en) | Microcomputer, electronic equipment and debugging system | |
JP3741182B2 (en) | Microcomputer, electronic equipment and debugging system | |
US7028237B2 (en) | Internal bus testing device and method | |
JP2006252006A (en) | Debug system, semiconductor integrated circuit device, microcomputer and electronic device | |
US6865638B1 (en) | Apparatus and method for transferring multi-byte words in a fly-by DMA operation | |
JP2001092686A (en) | Semiconductor device | |
US8352239B2 (en) | Emulator interface device and method thereof | |
JP5036448B2 (en) | FIFO memory reading method in in-circuit emulator and in-circuit emulator for one-chip microcomputer with built-in FIFO memory | |
JP2000284985A (en) | Debug system and information storage medium | |
JP2006133836A (en) | Microcomputer and method of manufacturing microcomputer | |
JP2008276441A (en) | Host controller, semiconductor integrated circuit, and host control method | |
JP2002358202A (en) | Portable information processing apparatus corresponding to plural types of programming language | |
JP2008293077A (en) | Host controller, electronic device, and error determination method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061114 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070115 |
|
RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20070115 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070206 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070405 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20070501 |