[go: up one dir, main page]

JP3741182B2 - Microcomputer, electronic equipment and debugging system - Google Patents

Microcomputer, electronic equipment and debugging system Download PDF

Info

Publication number
JP3741182B2
JP3741182B2 JP10372098A JP10372098A JP3741182B2 JP 3741182 B2 JP3741182 B2 JP 3741182B2 JP 10372098 A JP10372098 A JP 10372098A JP 10372098 A JP10372098 A JP 10372098A JP 3741182 B2 JP3741182 B2 JP 3741182B2
Authority
JP
Japan
Prior art keywords
debug
mode
microcomputer
debugging
write
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.)
Expired - Fee Related
Application number
JP10372098A
Other languages
Japanese (ja)
Other versions
JPH11282719A (en
Inventor
陽一 土方
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP10372098A priority Critical patent/JP3741182B2/en
Publication of JPH11282719A publication Critical patent/JPH11282719A/en
Application granted granted Critical
Publication of JP3741182B2 publication Critical patent/JP3741182B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Microcomputers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、マイクロコンピュータ、マイクロコンピュータを含む電子機器、及びデバッグシステムに関する。
【0002】
【背景技術及び発明が解決しようとする課題】
近年、ゲーム装置、カーナビゲーションシステム、プリンタ、携帯情報端末などの電子機器に組み込まれ、高度な情報処理を実現できるマイクロコンピュータに対する需要が高まっている。このような組み込み型のマイクロコンピュータは、通常、ターゲットシステムと呼ばれるユーザボードに実装される。そして、このターゲットシステムを動作させるソフトウェアの開発を支援するためにICE(In-Circuit Emulator)と呼ばれるソフトウェア開発支援ツールが広く使用されている。
【0003】
さて、このようなICEとしては、従来、図1(A)に示すようなCPU置き換え型と呼ばれるICEが主流を占めていた。このCPU置き換え型ICEでは、デバッグ時にターゲットシステム300からマイクロコンピュータ302を取り外し、その代わりにデバッグツール304のプローブ306を接続する。そして、このデバッグツール304に、取り外したマイクロコンピュータ302の動作をエミュレートさせる。また、このデバッグツール304に、デバッグのために必要な種々の処理を行わせる。
【0004】
しかしながら、このCPU置き換え型ICEには、プローブ306のピン数が多くなると共にプローブ306の線308が増えるという欠点があった。このため、マイクロコンピュータ302の高周波数動作をエミュレートすることが困難になる(例えば33MHZ程度が限界)。またターゲットシステム300の設計も困難になる。更に、マイクロコンピュータ302を実装して動作させる実動作時とデバッグツール304でマイクロコンピュータ302の動作をエミュレートするデバッグモード時とで、ターゲットシステム300の動作環境(信号のタイミング、負荷条件)が変化してしまう。またこのCPU置き換え型ICEには、マイクロコンピュータが異なれば、たとえそれが派生品であっても、設計が異なるデバッグツールや、ピン数やピンの位置が異なるプローブを使用しなければならないという問題もあった。
【0005】
一方、このようなCPU置き換え型ICEの欠点を解消するものとして、ICEと同じ機能を実現するためのデバッグ用のピンと機能を量産チップ上に実装するタイプのICEが知られている。このようなデバッグ機能実装型ICEにおいては、通常ユーザーモードとデバッグモードを有している。そしてユーザーモードにおいて、ユーザープログラムが実行され、デバッグモードにおいてはデバッグ用プログラムが実行される。
【0006】
ユーザーモード及びデバッグモードを有するマイクロコンピュータにおいては、デバッグ時にユーザーモードでユーザープログラムの実行中にプログラムの暴走や無限ループにおちいることがある。このような場合、ユーザーモードからデバッグモードに強制的に移行させるための手段が必要となる。このため、強制ブレークの機能が設けられており、通常強制ブレークを実現するための専用の外部端子を設けている。
【0007】
このように強制ブレークを実現するための外部入力端子を設けるとパッケージのピン数が増える。しかし、デバッグ時にのみ必要でエンドユーザーにとっては不要な端子はできるかぎり少ないほうが好ましい。
【0008】
一方このようなデバッグ機能実装型ICEにおいては 外部(チップ以外のハード等)との通信が不可欠である。しかし外部のデバッグツールと送受信はデバッグモード時のみに行われる。このためユーザーモード時にはこの送受信用端子は使用されない。
【0009】
強制ブレークを入力するための端子やデバッグモード時にのみ使用する端子はエンドユーザーにとっては不要な物であるためより少ないほうが好ましい。
【0010】
本発明は、以上のような技術的課題に鑑みてなされたものであり、その目的とするところは、デバッグ用のピンと機能を量産チップ上に実装するタイプのICEにおいて、強制ブレークを入力するための端子及びデバッグモード時にのみ使用する端子等のエンドユーザーにとっては不要な端子をより節約したマイクロコンピュータ、これを含む電子機器、及びデバッグシステムを提供することにある。
【0011】
【課題を解決するための手段】
上記課題を解決するために本発明は、ユーザーモード及びデバッグモードを有するマイクロコンピュータであって、ユーザーモード及びデバッグモードが切り替え可能に形成され、それぞれのモードにおいて命令の実行処理を行う中央処理ユニットと、ユーサーモードでは使用されない端子を介して強制ブレークの入力がされると、前記中央処理ユニットをユーザーモードからデバッグモードに切り替える切り替え手段とを含むことを特徴とする。
【0012】
ここにおいて強制ブレークとは、ユーサーモードからデバッグモードに強制的に移行させることをいう。
【0013】
本発明によればユーザーモードでは使用されない端子、例えばデバッグモードでのみ使用される端子を用いて強制ブレークの入力を行う。従って強制ブレーク専用端子を設ける必要が無いため、マイクロコンピュータの端子の節約となり、ユーザーが使用可能な端子をより多く確保することができる。
【0014】
また本発明は、前記マイクロコンピュータが、オンチップデバッグ機能を有し、オンチップデバッグを行うためのデバッグ情報を外部のデバッグツールと送受信するための通信ラインが接続されるデバッグ用通信端子を含み、前記デバッグ用端子を介して強制ブレークの入力がされることを特徴とする。
【0015】
オンチップデバッグ機能を有するマイクロコンピュータでは通常外部(チップ以外のハード等)との通信が必要となる。しかし外部のデバッグツールと送受信はデバッグモード時のみに行われ、ユーザーモード時にはこのデバッグ用端子は使用されない。
【0016】
一方強制ブレークの入力はユーザーモードからデバッグモードへ切り替えるための入力であるためユーザーモードでのみ発生する。
【0017】
このようにデバッグ情報と強制ブレーク入力は異なるモードでしか発生しないため、同一の端子を共用してもそれぞれを判別可能で混同は生じない。
【0018】
本発明によれば、オンチップデバッグに必要な端子と強制ブレークを入力するための端子を共用するため、ユーザーが使用可能な端子をより多く確保することができる。
【0019】
また本発明は、前記マイクロコンピュータが、マイクロコンピュータの外部に設けられデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段とを含み、前記データを半2重の双方向通信で送受信を行うための1本の通信ラインが接続されるデバッグ用端子を含み、前記中央処理ユニットは、ユーザーモードにおいてはユーザープログラムの実行処理を行い、デバッグモードにおいて前記プリミティブコマンドの実行処理を行い、前記切り替え手段は、前記デバッグ用端子を介して強制ブレークの入力がされると、前記中央処理ユニットをユーザーモードからデバッグモードに切り替えることを特徴とする。
【0020】
本発明によれば、マイクロコンピュータの外部に設けられた第2のモニタ手段が、ホストシステム等が発行したデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。そして、第1のモニタ手段は、この第2のモニタ手段からデータを受信し、この受信データに基づいて決定されたプリミティブコマンドを実行するための処理を行う。本発明によれば、第1のモニタ手段の処理を実行するためのモニタプログラムに、各デバッグコマンドを実行するための複雑なルーチンを持たせる必要がなくなる。したがって、モニタプログラムの命令コードサイズを格段に小さくできるようになり、小さなハードウェア規模でオンチップデバッグ機能を実現できるようになる。
【0021】
またマイクロコンピュータのデバッグ用端子(ピン)数を減らすことが可能となり、マイクロコンピュータの低コスト化を図れるようになる。
【0022】
また本発明は、外部のデバッグツールが接続されていない状態には強制ブレークの入力が行われる端子をハイ又はローのいずれかである第一のレベルに保持する手段を含み、前記中央処理ユニットは、リセット時に前記強制ブレークの入力が行われる端子が前記第一のレベルである場合にはユーザーモードで実行を開始し、リセット時に前記強制ブレークの入力が行われる端子が前記第一のレベルでない場合にはデバッグモードで実行を開始することを特徴とする。
【0023】
本発明によれば、外部のデバッグツールが接続されていない場合にはプルアップ等によりハイ又はローのいずれかである示す第一のレベルに保持されている。従って前記デバッグ用端子を接続することにより、前記強制ブレークの入力が行われる端子が前記第一のレベルとは逆のレベルになるよう構成すると、リセット時に前記端子の状態でユーザーモードで開始すべきかデバッグモードで開始すべきか判断可能となる。
【0024】
一方外部のデバッグツールが接続されている場合にはデバッグ中であるため、リセット時にはデバッグモードで実行を開始することが好ましい。またデバッグツールが接続されていない場合には、ユーザーが意識しなくても、ユーザーモードで実行を開始することが好ましい。
【0025】
本発明によれば、前記デバッグ用端子がハイであるかローであるかを検出するという簡単な構成で、ユーザー側では意識することなくリセット時に適切なモードで実行を開始することができる。
【0026】
また本発明の電子機器は、上記いずれかに記載のマイクロコンピュータと、前記マイクロコンピュータの処理対象となるデータの入力源と、前記マイクロコンピュータにより処理されたデータを出力するための出力装置とを含むことを特徴とする。
【0027】
このようにすれば、電子機器を動作させるプログラムなどのデバッグ作業の効率化を図れるようになり、電子機器の開発期間の短縮化、低コスト化を図れるようになる。
【0028】
また本発明は、マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、ホストシステムが発行したデバッグコマンドを少なくとも1つのプリミティブコマンドに変換するための処理を行う第2のモニタ手段と、
前記第2のモニタ手段との間でデータを送受信し、実行するプリミティブコマンドを前記第2のモニタ手段からの受信データに基づいて決定し、決定したプリミティブコマンドを実行するための処理を行う第1のモニタ手段と、ユーザーモード及びデバッグモードが切り替え可能に形成され、ユーザーモードにおいて前記プリミティブコマンドの実行処理を行う中央処理ユニットと、前記中央処理ユニットを含むチップに設けられ、前記データを半2重の双方向通信を行うための1本の通信ラインが接続されるデバッグ用端子と、前記デバッグ用端子を介して強制ブレークの入力がされると、前記中央処理ユニットをユーザーモードからデバッグモードに切り替える切り替え手段とを含むことを特徴とする。
【0029】
本発明によれば、第1のモニタ手段の処理を実行するためのモニタプログラムの命令コードサイズを格段に小さくできる。これにより、ユーザが自由に使用できるメモリ領域や端子数を増やすことが可能になる。また、ターゲットシステムを、実動作時の環境と同一の環境でデバッグできるデバッグシステムを提供できるようになる。
【0030】
【発明の実施の形態】
以下、本発明の好適な実施形態について図面を用いて詳細に説明する。
【0031】
1.本実施形態の特徴
まず本実施形態の特徴について図2(A)(B)を用いて説明する。図2(A)(B)はいずれもユーザーモード及びデバッグモードを有するマイクロコンピュータ10とデバッグツール14が接続されている様子を示した図である。
【0032】
マイクロコンピュータ10はCPU(中央処理ユニット)12とオンチップデバッグ部13、強制ブレーク制御部15、クロック生成部17を含む。オンチップデバッグ部13はデバッグモード時にデバッグツール14とデバッグ情報の送受を行い、デバッグ用プログラムを実行して種々のデバッグ処理を行う。
【0033】
また、マイクロコンピュータ10はデバッグ用端子としてSIOD16とBCLK18を含んでいる。SIOD16はユーザーモード時には強制ブレークの入力信号を受け付け、デバッグモード時には調歩同期式のSIOで外部のデバッグツール14とデバッグ情報の送受信を行う。BCLK18はクロック生成部17により供給され、調歩同期式の同期クロックとして使用される。
【0034】
ところで外部のデバッグツール14との送受信はデバッグモード時のみに行われ、ユーザーモード時にはこのデバッグ用端子は使用されない。一方強制ブレークの入力はユーザーモードからデバッグモードへ切り替えるための入力であるためユーザーモード時のみ発生する。
【0035】
従って強制ブレーク制御部15は、ユーザーモード時に信号を受けた場合には強制ブレークの入力があったものと判断し、CPU12をユーザーモードからデバッグモードに切り替える処理を行う(図2(A)参照)。またデバッグモード時に信号を受けた場合にはデバッグ情報である判断し、当該デバッグ情報をオンチップデバッグ部13に出力する(図2(B)参照)。
【0036】
このようにデバッグ情報の送受信と強制ブレークの入力は異なるモードでしか発生しないため、図2(A)(B)に示すように同一の端子を共用してもそれぞれを判別可能で混同は生じない。
【0037】
そこで本実施の形態では、SIOD16は、ユーザーモードでは図2(A)に示すように強制ブレークの入力信号を入力する端子として機能し、デバッグモードでは図2(B)に示すようにデバッグ情報の送受信を行うための端子として機能するよう構成されている。
【0038】
このようにすることでデバッグ時に必要な端子数を節約し、ユーザーが使用可能な端子をより多く確保することができる。
【0039】
図3は強制ブレークの入力とSIOD端子の状態の関係を表したタイミングチャート図である。
【0040】
16’はデバッグツール14側の出力状態のSIODを示し、16はマイクロコンピュータ側の入力状態のSIODを示している。デバッグツール側はユーザーモード中はハイレベルの信号を出力しており、外部からの強制ブレークの入力によりローパルスが出力される(222)。マイクロコンピュータ側ではこのローパルスを受けて、ユーザーモードからデバッグモードに移行する(228)。そしてデバッグツール14側は、一定期間ハイレベルの信号を出力(224)した後、調歩同期式でデバッグ情報の通信を開始する。
【0041】
図4(A)(B)は本実施の形態の第二の特徴について説明するための図である。図4(A)に示すように、マイクロコンピュータ10がデバッグツール未接続時には、SIOD端子はプルアップのためハイレベルになる。ところが図4(B)に示すようにデバッグツール14を接続することにより、SIOD端子16を任意のレベル(ハイレベル又はローレベル)にすることができる。
【0042】
本実施の形態では、デバッグツール14をマイクロコンピュータ10に接続することにより、SIOD端子16がローレベルになるようデバッグツール14からローレベルの信号を出力している。
【0043】
図5(A)(B)は、SIOD端子の状態とリセット時の開始モードを説明するための図である。
【0044】
図5(A)に示すようにユーザーRESETの立ち上がり(230)でSIODがハイレベルの場合には、マイクロコンピュータはユーザーモードで実行を開始する(232)。
【0045】
図5(B)に示すようにユーザーRESETの立ち上がり(234)でSIODがローレベルの場合にはマイクロコンピュータはデバッグモードで実行を開始する(236)。従って、マイクロコンピュータはデバッグモードに移行し(238)、デバッグツール側は、一定期間ハイレベルの信号を出力(240)した後、調歩同期式でデバッグ情報の通信を開始する(242)。
【0046】
このように、ユーザーリセット時にSIODがハイレベルであるかローレベルであるかを検出するという簡単な構成で、ユーザー側では意識することなくリセット時に適切なモードで実行を開始することができる。
【0047】
次に本実施の形態の第3の特徴について説明する。図2(A)(B)においてオンチップデバッグ部14が以下に説明するミニモニタ部314に相当する機能を有している場合に相当する。
【0048】
図6に示すように、本実施形態では、マイクロコンピュータ10が、CPU(中央処理ユニット)12及びミニモニタ部(第1のモニタ手段)314を含む。また、マイクロコンピュータ10の外部にはメインモニタ部(第2のモニタ手段)316が設けられている。ここでメインモニタ部316は、例えばホストシステムなどが発行したデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。また、ミニモニタ部314は、メインモニタ部316との間でデータを送受信する。そして、ミニモニタ部314は、実行するプリミティブコマンドを、メインモニタ部316からの受信データに基づいて決定し、プリミティブコマンドを実行するための処理を行う。
【0049】
ここで、メインモニタ部316の変換処理の対象となるデバッグコマンドとしては、プログラムロード、GO、ステップ実行、メモリライト、メモリリード、内部レジスタライト、内部レジスタリード、ブレークポイント設定、ブレークポイント解除などのコマンドを考えることができる。メインモニタ部316は、これらの多様で複雑なデバッグコマンドを、例えばGO、ライト(デバッグモード時におけるメモリマップ上の所与のアドレスへのライト)、リード(メモリマップ上の所与のアドレスからのリード)などの、シンプルでプリミティブなコマンドに変換する処理を行う。このようにすることで、ミニモニタ部314の処理を行うミニモニタプログラムの命令コードサイズを格段に小さくすることができる。これにより、マイクロコンピュータ10のオンチップデバッグ機能を実現できるようになる。
【0050】
通常デバッグ用のプログラムはプログラムロード、GO、ステップ実行などのデバッグコマンドの全ての処理ルーチンを有しているため、大きなメモリを必要としマイクロコンピュータに内蔵することは事実上困難であった。
【0051】
しかし本実施形態では、ミニモニタ部314の処理を行うミニモニタプログラムは、GO、ライト、リードなどのシンプルなプリミティブコマンドの処理ルーチンのみを有し、命令コードサイズが非常に小さい(例えば256バイト)。したがって、ミニモニタプログラムをマイクロコンピュータ10に内蔵することが可能となり、オンチップデバッグ機能を実現できるようになる。また、ユーザが自由に使用できるメモリ領域が減少してしまうのを最小限から0に抑えることも可能になる。
【0052】
2.詳細な構成例
図7に本実施形態のマイクロコンピュータ及びデバッグシステムの詳細な構成例を示す。図7に示すように、マイクロコンピュータ20は、CPU22、BCU(バス制御ユニット)26、内部メモリ(ミニモニタROM42及びミニモニタRAM44以外の内部ROM及び内部RAM)28、クロック生成部30、ミニモニタ部40(第1のモニタ手段)、トレース部50を含む。
【0053】
ここでCPU22は、種々の命令の実行処理を行うものであり、内部レジスタ24を含む。内部レジスタ24は、汎用レジスタであるR0〜R15や、特殊レジスタであるSP(スタックポインタレジスタ)、AHR(積和結果データの上位レジスタ)、ALR(積和結果データの下位レジスタ)などを含む。なお、CPU22は、ユーザーモードとデバッグモードを有しており、ライン51を介して強制ブレーク制御部49からの強制ブレークの入力を受けるとユーザーモードからデバッグモードに切り替わるように構成されている。
【0054】
BCU26はバスを制御するものである。例えば、CPU22に接続されるハーバードアーキテクチャのバス31や、内部メモリ28に接続されるバス32や、外部メモリ36に接続される外部バス33や、ミニモニタ部40、トレース部50などに接続される内部バス34の制御を行う。またクロック生成部30は、マイクロコンピュータ20内で使用される各種のクロックを生成するものである。クロック生成部30はBCLKを介して外部のデバッグツール60にもクロックを供給している。
【0055】
ミニモニタ部40は、ミニモニタROM42、ミニモニタRAM44、制御レジスタ46、SIO48、強制ブレーク制御部49を含む。
【0056】
ここで、ミニモニタROM42には、ミニモニタプログラムが格納される。本実施形態では、このミニモニタプログラムは、GO、リード、ライトなどのシンプルでプリミティブなコマンドの処理のみを行うようになっている。このため、ミニモニタROM42のメモリ容量を例えば256バイト程度に抑えることができ、オンチップデバッグ機能を持たせながらマイクロコンピュータ20を小規模化できるようになる。
【0057】
ミニモニタRAM44には、デバッグモードへの移行時に(ユーザプログラムのブレーク発生時に)、CPU22の内部レジスタ24の内容が退避される。これにより、デバッグモードの終了後にユーザプログラムの実行を適正に再スタートできるようになる。また内部レジスタの内容のリード等を、ミニモニタプログラムが持つプリミティブなリードコマンド等で実現できるようになる。
【0058】
制御レジスタ46は、各種のデバッグ処理を制御するためのレジスタであり、ステップ実行イネーブルビット、ブレークイネーブルビット、ブレークアドレスビット、トレースイネーブルビットなどを有する。ミニモニタプログラムにより動作するCPU22が制御レジスタ46の各ビットにデータをライトしたり、各ビットのデータをリードすることで、各種のデバッグ処理が実現される。
【0059】
SIO48は、マイクロコンピュータ20の外部に設けられたデバッグツール60との間で送受信するデバッグ用のデータの制御を行うものである。
【0060】
強制ブレーク制御部49とデバッグツール60との間は、SIOD(データ送受信ライン)で接続されており、強制ブレークの入力及びデバッグ情報が送受信される。
【0061】
強制ブレーク制御部49は、前記SIODを介してユーザーモード時に信号を受けた場合には強制ブレークの入力があったものと判断し、ライン51を介してCPU12をユーザーモードからデバッグモードに切り替えるための信号を送る処理を行う。また、デバッグモード時に信号を受けた場合にはデバッグ情報であると判断し、当該デバッグ情報をSIO48に出力する処理を行う。
【0062】
トレース部50は、リアルタイムトレース機能を実現するためのものである。トレース部50とデバッグツール60との間は、CPU22の命令実行のステートを表す3ビットのDST[2:0]と、分岐先のPC(プログラムカウンタ)値を表すDPCOという4本のラインで接続されている。
【0063】
デバッグツール60はメインモニタ部62を含み、パーソナルコンピュータ等により実現されるホストシステム66に接続される。ホストシステム66が、ユーザの操作により、プログラムロード、ステップ実行などのデバッグコマンドを発行すると、メインモニタ部62が、このデバッグコマンドをプリミティブコマンドに変換(分解)するための処理を行う。そして、メインモニタ部62が、プリミティブコマンドの実行を指示するデータをミニモニタ部40に送信すると、ミニモニタ部40が、指示されたプリミティブコマンドを実行するための処理を行うことになる。
【0064】
図8に、デバッグモード時のメモリマップの例を示す。図8のD1、D2、D3に示すように、デバッグモード時には、図7の制御レジスタ46、ミニモニタRAM44、ミニモニタROM42のアドレスも、メモリマップ上に割り付けられる。
【0065】
3.プリミティブコマンドへの変換
図9(A)、(B)、(C)、(D)に、各種のデバッグコマンドをプリミティブコマンドへ変換する処理について模式的に示す。
【0066】
例えば図9(A)に示すように、(ADD・・・、SUB・・・、AND・・・、OR・・・、XOR・・・、LD.W・・・)という12バイトのプログラムを80010h番地にロードするというデバッグコマンドが発行されたとする。この場合、このプログラムロードコマンドは、ライト(80010h、ADD・・・、SUB)、ライト(80014h、AND・・・、OR・・・)、ライト(80018h、XOR・・・、LD.W・・・)という3つのプリミティブなライトコマンドに変換される。即ち、ミニモニタプログラムが、この3つのプリミティブなライトコマンドを実行することで、プログラムロードコマンドが実現されるようになる。
【0067】
また図9(B)に示すようにステップ実行コマンドというデバッグコマンドが発行されたとする。すると、このステップ実行コマンドは、図7の制御レジスタ46のステップ実行イネーブルビットへのライトコマンド(図8のD1のアドレスへのライトコマンド)とGOコマンドに変換される。即ち、ミニモニタプログラムが、このプリミティブなライトコマンドとGOコマンドを実行することで、ステップ実行コマンドが実現されるようになる。
【0068】
また図9(C)に示すように内部レジスタリードコマンドというデバッグコマンドが発行されたとする。すると、この内部レジスタリードコマンドは、メモリマップ上のミニモニタRAM(内部レジスタの内容の退避先)からのリードコマンド(図8のD2のアドレスからのリードコマンド)に変換される。即ち、ミニモニタプログラムが、このプリミティブなリードコマンドを実行することで、内部レジスタリードコマンドが実現されるようになる。内部レジスタライトコマンド、メモリリードコマンド、メモリライトコマンドも同様にして実現される。
【0069】
また図9(D)に示すようにブレークポイント設定コマンドというデバッグコマンドが発行されたとする。すると、このブレークポイント設定コマンドは、制御レジスタ46のブレークイネーブルビット及びブレークアドレスビットへのライトコマンドに変換される。即ち、ミニモニタプログラムが、このプリミティブなライトコマンドを実行することで、ブレークポイント設定コマンドが実現されるようになる。
【0070】
このように本実施形態では、複雑で多様なデバッグコマンドが、プリミティブでシンプルなリード、ライト、GOコマンドに変換される。そして、ミニモニタプログラムは、このプリミティブなリード、ライト、GOコマンドを実行するだけでよいため、ミニモニタプログラムの命令コードサイズは非常に小さくなる。この結果、ミニモニタROM42のメモリ容量も小さくでき、小さなハードウェア規模でオンチップデバッグ機能を実現できるようになる。
【0071】
4.SIOの構成例
図10にSIO48の構成例を示す。SIO48は、送受信バッファ70、シフトレジスタ76、送受信切替部78、クロック制御部80及び制御レジスタ84を含む。
【0072】
ここで送受信バッファ70は、送信データ、受信データを一時的に蓄えるためのものであり、送信バッファ72、受信バッファ74を有する。シフトレジスタ76は、送信バッファ72からの送信データをパラレルデータからシリアルデータに変換し送受信切替部78に出力する機能を有する。また送受信切替部78からの受信データをシリアルデータからパラレルデータに変換し受信バッファ74に出力する機能も有する。送受信切替部78は、データの送信と受信とを切り替えるためのものである。これにより、SIODを使用した半2重のデータ送受信が可能になる。
【0073】
クロック制御部80は、内蔵する分周回路82によりBCLKを分周し、この分周により得られたサンプリングクロックSMC1をシフトレジスタ76に出力する。シフトレジスタ76は、このSMC1に基づき動作する。またこのBCLKはデバッグツール60に供給されるため、マイクロコンピュータ20とデバッグツール60により、BCLKが共有されるようになる。
【0074】
分周回路82での分周比は制御レジスタ84により設定される。即ちCPU22により実行されるミニモニタプログラムが、所望の分周比を制御レジスタ84に書き込むことで、分周回路82での分周比が設定されることになる。
【0075】
5.デバッグツールの構成例
図11にデバッグツール60の構成例を示す。
【0076】
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端子に出力する。
【0077】
アドレスアップカウンタ100は、トレースメモリのアドレスをカウントアップするためのものである。セレクタ102は、ライン122(アドレスアップカウンタ100が出力するアドレス)とライン124(アドレスバス120からのアドレス)のいずれかを選択し、トレースメモリ104のアドレス端子にデータを出力する。またセレクタ106は、ライン126(図3のトレース部50の出力であるDST[2:0]、DPCO)とライン128(データバス118)のいずれかを選択し、トレースメモリ104のデータ端子にデータを出力したり、データ端子からデータを取り出す。
【0078】
ROM108はメインモニタROM110(図3のメインモニタ部62に相当)を含み、メインモニタROM110には、メインモニタプログラムが格納される。このメインモニタプログラムは、図5(A)〜図5(D)で説明したように、デバッグコマンドをプリミティブコマンドに変換するための処理を行う。RAM112は、CPU90のワーク領域となるものである。
【0079】
RS232Cインターフェース114、パラレルインターフェース116は、図3のホストシステム66とのインターフェースとなるものであり、ホストシステム66からのデバッグコマンドはこれらのインターフェースを介してCPU90に入力されることになる。クロック生成部118は、CPU90を動作させるクロックなどを生成するものである。
【0080】
6.データの送受信
さて、図12(A)に示すように、ミニモニタ部40とメインモニタ部62の間でのデバッグデータの通信の手法としては、TXD(送信)とRXD(受信)のラインを別々に設け、全2重で通信する手法が考えられる。
【0081】
しかしながら、このようにデバッグデータの通信のために2本のライン(端子)を使用してしまうと、その分だけマイクロコンピュータの端子数(ピン数)が増えてしまい、これはマイクロコンピュータの高コスト化を招く。
【0082】
そこで本実施形態では、図12(B)に示すように、ミニモニタ部40とメインモニタ部62との間に1本のTXD/RXDライン(双方向通信ライン)を設け、半2重の双方向通信を行う。なお本実施の形態では、このラインを強制ブレークを入力するためのSIODと共用している。このため、マイクロコンピュータの端子数の増加を最小限に抑えることができ、マイクロコンピュータの低コスト化を図れる。
【0083】
そして更に本実施形態では、図12(C)に示すように、スレーブとなるミニモニタ部40が、マスタとなるメインモニタ部62からデータを受信したことを条件に、その受信データに対応する処理を行い、その受信データに対応する応答データをメインモニタ部62に送信する。即ち、メインモニタ部62がデータ(コマンド)をミニモニタ部40に送信すると、ウェイト状態となっていたミニモニタ部40がこれを受信し、その受信データに対応する処理を行う。そして、その受信データに対応するデータ(リプライ)をメインモニタ部62に送信する。その後、ミニモニタ部40は、メインモニタ部62からデータを受信するまでウェイト状態になる。即ちミニモニタ部40は、メインモニタ部62からデータを受信するまで動作を停止し、データを受信したことを条件に動作を開始する。このようにすることで、ミニモニタ部40とメインモニタ部62との間の通信ラインを1本にしながら、データを適正に送受信できるようになる。
【0084】
7.ミニモニタ部の詳細な処理例
次にミニモニタ部の詳細な処理例について説明する。
【0085】
図13に示すように、ユーザプログラムの実行中にブレークが発生すると、ミニモニタプログラムの処理がスタートし、ユーザプログラム実行モードからデバッグモードに移行する。そして、ミニモニタプログラムが所与のコマンド処理を行いリターン命令を実行すると、デバッグモードからユーザプログラム実行モードに戻る。
【0086】
図14、図15に、デバッグモードでのミニモニタプログラムの処理を表すフローチャートを示す。
【0087】
デバッグモードに移行すると、ミニモニタプログラムは、まず、図7のCPU22の内部レジスタ24の内容をモニタRAM44に退避する(ステップS1)。そして、ミニモニタプログラムが使用する制御レジスタ46の設定処理を行う(ステップS2)。
【0088】
次に、デバッグツール60から受信した14バイトのデータを、受信バッファ74(図10参照)にライトする(ステップS3)。そして、受信バッファ74のデータの先頭の1バイト(コマンド識別データID)をチェックする(ステップS4)。
【0089】
そして図13に示すように、IDがリードコマンドを示すものであった場合には、受信バッファ74からリードアドレスを取得する(ステップS5、S6)。そして、取得したリードアドレスからデータをリードし、送信バッファ72にライトする(ステップS7)。次に、送信バッファ72のデータをデバッグツール60に送信する(ステップS8)。そして、図23のステップS3に戻り、次の受信データを受信バッファ74にライトする。
【0090】
IDがライトコマンドを示すものであった場合には、受信バッファ74からライトアドレスを取得する(ステップS9、S10)。そして、受信バッファ74からライトデータを取得し、ステップS10で取得したライトアドレスにライトする(ステップS11)。
【0091】
IDが外部ルーチンジャンプコマンドを示すものであった場合には、受信バッファ74からルーチンアドレスを取得する(ステップS12、S13)。そして、外部ルーチンにジャンプ後、ミニモニタプログラムにリターンする(ステップS14)。
【0092】
IDがGOコマンドを示すものであった場合には、モニタRAM44に退避したデータを内部レジスタ24にリストアする(ステップS15、S16)。そして、図13に示すようにユーザプログラムにリターンし、デバッグモードから抜ける(ステップS17)。
【0093】
一方、IDがリード、ライト、外部ルーチンジャンプ、GOコマンドのいずれでもなかった場合には、処理が必要ないと判断する(ステップS15、S18)。そして送信バッファ72にダミーのデータをライトする(ステップS19)。なお、図15では、データフィルコマンドの処理については省略している。
【0094】
以上のようにして、デバッグコマンドを変換することで得られたプリミティブコマンドが、ミニモニタプログラムにより実行されることになる。
【0095】
8.電子機器
次に、以上の本実施形態のマイクロコンピュータを含む電子機器に関して説明する。
【0096】
例えば図16(A)に電子機器の1つであるカーナビゲーションシステムの内部ブロック図を示し、図17(A)にその外観図を示す。カーナビゲーションシステムの操作はリモコン510を用いて行われ、GPSやジャイロからの情報に基づいて位置検出部520が車の位置を検出する。地図などの情報はCDROM530(情報記憶媒体)に格納されている。画像メモリ540は画像処理の際の作業領域になるメモリであり、生成された画像は画像出力部550を用いて運転者に表示される。マイクロコンピュータ500は、リモコン510、位置検出部520、CDROM530などのデータ入力源からデータを入力し、種々の処理を行い、処理後のデータを画像出力部550などの出力装置を用いて出力する。
【0097】
図16(B)に電子機器の1つであるゲーム装置の内部ブロック図を示し、図17(B)にその外観図を示す。このゲーム装置では、ゲームコントローラ560からのプレーヤの操作情報、CDROM570からのゲームプログラム、ICカード580からのプレーヤ情報等に基づいて、画像メモリ590を作業領域としてゲーム画像やゲーム音を生成し、画像出力部610、音出力部600を用いて出力する。
【0098】
図16(C)に電子機器の1つであるプリンタの内部ブロック図を示し、図17(C)にその外観図を示す。このプリンタでは、操作パネル620からの操作情報、コードメモリ630及びフォントメモリ640から文字情報に基づいて、ビットマップメモリ650を作業領域として、印刷画像を生成し、プリント出力部660を用いて出力する。またプリンタの状態やモードを表示パネル670を用いてユーザに伝える。
【0099】
本実施形態のマイクロコンピュータ又はデバッグシステムによれば、図16(A)〜図17(C)の電子機器を動作させるユーザプログラムの開発の容易化、開発期間の短縮化を図れるようになる。またマイクロコンピュータが実動作する環境と同じ環境で、ユーザプログラムのデバッグ作業を行うことができるため、電子機器の信頼性を高めることができる。また電子機器に組み込まれるマイクロコンピュータのハードウェアを小規模化、低コスト化できるため、電子機器の低コスト化も図れるようになる。更にミニモニタプログラムの命令コードサイズは小さいため、ユーザがプログラムや各種データの格納に使用するメモリ領域を全く使用しないことが可能になる。
【0100】
なお本実施形態のマイクロコンピュータを適用できる電子機器としては、上記以外にも例えば、携帯電話(セルラーフォン)、PHS、ページャ、オーディオ機器、電子手帳、電子卓上計算機、POS端末、タッチパネルを備えた装置、プロジェクタ、ワードプロセッサ、パーソナルコンピュータ、テレビ、ビューファインダ型又はモニタ直視型のビデオテープレコーダなど種々のものを考えることができる。
【0101】
なお、本発明は本実施形態に限定されず、本発明の要旨の範囲内で種々の変形実施が可能である。
【0102】
【図面の簡単な説明】
【図1】CPU置き換え型のICEの例を示す図である。
【図2】図2(A)(B)は、本実施形態の特徴について説明するための図である。
【図3】強制ブレークの入力とSIOD端子の状態の関係を表したタイミングチャート図である。
【図4】図4(A)(B)は本実施の形態の第二の特徴について説明するための図である。
【図5】図5(A)(B)は、SIOD端子の状態とリセット時の開始モードを説明するための図である。
【図6】本実施の形態の第三の特徴について説明するための図である。
【図7】本実施形態のマイクロコンピュータ、デバッグシステムの構成例を示す機能ブロック図である。
【図8】デバッグモード時のメモリマップを示す図である。
【図9】図9(A)、(B)、(C)、(D)は、デバッグコマンドをプリミティブコマンドへ変換(分解)する処理について説明するための図である。
【図10】SIOの構成例を示す機能ブロック図である。
【図11】デバッグツールの構成例を示す機能ブロック図である。
【図12】図12(A)、(B)、(C)は、ミニモニタ部とメインモニタ部との間の通信手法について説明するための図である。
【図13】ユーザプログラム実行モードからデバッグモードへの移行について説明するための図である。
【図14】本実施形態の詳細な処理例を説明するためのフローチャートである。
【図15】本実施形態の詳細な処理例を説明するためのフローチャートである。
【図16】図16(A)、(B)、(C)は、種々の電子機器の内部ブロック図の例である。
【図17】図17(A)、(B)、(C)は、種々の電子機器の外観図の例である。
【符号の説明】
10 マイクロコンピュータ
12 CPU(中央処理ユニット)
13 オンチップデバッグ部
14 デバッグツール
15 強制ブレーク制御部
16 SIOD
17 クロック制御部
18 BCLK
20 マイクロコンピュータ
22 CPU(中央処理ユニット)
24 内部レジスタ
26 BCU(バス制御ユニット)
28 内部メモリ
30 クロック生成部
31 バス
32 バス
33 外部バス
34 内部バス
36 外部メモリ
40 ミニモニタ部(第1のモニタ手段)
42 ミニモニタROM
44 ミニモニタRAM
46 制御レジスタ
48 SIO
49 強制ブレーク制御部
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 クロック生成部
316 メインモニタ部(第2のモニタ手段)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microcomputer, an electronic device including the microcomputer, and a debugging system.
[0002]
[Background Art and Problems to be Solved by the Invention]
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.
[0003]
Conventionally, as such ICE, an ICE called a CPU replacement type as shown in FIG. In this CPU replacement type ICE, the microcomputer 302 is removed from the target system 300 during debugging, and the probe 306 of the debugging tool 304 is connected instead. Then, the debugging tool 304 is made to emulate the operation of the removed microcomputer 302. Further, the debug tool 304 is caused to perform various processes necessary for debugging.
[0004]
However, this CPU replacement type ICE has a drawback that the number of pins of the probe 306 increases and the number of lines 308 of the probe 306 increases. For this reason, it becomes difficult to emulate the high frequency operation of the microcomputer 302 (for example, about 33 MHZ is a limit). Also, the design of the target system 300 becomes difficult. Furthermore, the operating environment (signal timing and load condition) of the target system 300 changes between the actual operation in which the microcomputer 302 is mounted and operated and the debug mode in which the debugging tool 304 emulates the operation of the microcomputer 302. Resulting in. In addition, this CPU replacement type ICE has a problem that, if the microcomputer is different, even if it is a derivative product, it is necessary to use a debugging tool with a different design or a probe with a different number of pins or pin positions. there were.
[0005]
On the other hand, as a means for solving such a disadvantage of the CPU replacement type ICE, there is known an ICE of a type in which a debugging pin and a function for realizing the same function as the ICE are mounted on a mass production chip. Such a debug function implementation type ICE normally has a user mode and a debug mode. The user program is executed in the user mode, and the debugging program is executed in the debug mode.
[0006]
In a microcomputer having a user mode and a debug mode, the program may be runaway or in an infinite loop during execution of the user program in the user mode during debugging. In such a case, a means for forcibly shifting from the user mode to the debug mode is required. For this reason, a forced break function is provided, and a dedicated external terminal for realizing a normal forced break is provided.
[0007]
When the external input terminal for realizing the forced break is provided as described above, the number of pins of the package is increased. However, it is preferable that the number of terminals necessary only for debugging and unnecessary for the end user is as small as possible.
[0008]
On the other hand, in such a debug function mounting type ICE, communication with the outside (hardware other than the chip) is indispensable. However, transmission / reception with an external debug tool is performed only in the debug mode. Therefore, this transmission / reception terminal is not used in the user mode.
[0009]
The number of terminals for inputting a forced break and the terminals used only in the debug mode are unnecessary because they are unnecessary for the end user.
[0010]
The present invention has been made in view of the technical problems as described above, and an object thereof is to input a forced break in an ICE of a type in which debugging pins and functions are mounted on a mass-produced chip. It is an object of the present invention to provide a microcomputer, an electronic device including the microcomputer, and a debugging system that can save unnecessary terminals for an end user such as a terminal used only in the debugging mode.
[0011]
[Means for Solving the Problems]
In order to solve the above problems, the present invention is a microcomputer having a user mode and a debug mode, wherein the user mode and the debug mode are formed to be switchable, and a central processing unit that executes instructions in each mode, and And switching means for switching the central processing unit from the user mode to the debug mode when a forced break is input through a terminal not used in the user mode.
[0012]
Here, the forced break refers to forcibly shifting from the user mode to the debug mode.
[0013]
According to the present invention, a forced break is input using a terminal that is not used in the user mode, for example, a terminal that is used only in the debug mode. Accordingly, since there is no need to provide a dedicated terminal for forced break, the terminals of the microcomputer can be saved, and more terminals that can be used by the user can be secured.
[0014]
The present invention also includes a debugging communication terminal to which the microcomputer has an on-chip debugging function, and a communication line for transmitting and receiving debugging information for performing on-chip debugging with an external debugging tool is connected. A forced break is input through the debugging terminal.
[0015]
A microcomputer having an on-chip debugging function usually requires communication with the outside (hardware other than a chip). However, transmission / reception with an external debug tool is performed only in the debug mode, and this debug terminal is not used in the user mode.
[0016]
On the other hand, the forced break input occurs only in the user mode since it is an input for switching from the user mode to the debug mode.
[0017]
As described above, debug information and forced break input occur only in different modes. Therefore, even if the same terminal is shared, each can be distinguished and no confusion occurs.
[0018]
According to the present invention, since a terminal necessary for on-chip debugging and a terminal for inputting a forced break are shared, more terminals that can be used by the user can be secured.
[0019]
The present invention also provides a primitive in which the microcomputer transmits / receives data to / from second monitor means that is provided outside the microcomputer and performs processing for converting a debug command into at least one primitive command. A first monitor means for determining a command based on the received data from the second monitor means and performing a process for executing the determined primitive command, and transmitting the data by half-duplex bidirectional communication Including a debugging terminal to which one communication line for performing transmission and reception is connected, the central processing unit performs execution processing of a user program in user mode, performs execution processing of the primitive command in debug mode, The switching means is forcibly blurred via the debugging terminal. When the input of the click is, and switches the central processing unit to the debug mode from user mode.
[0020]
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.
[0021]
Further, the number of debugging terminals (pins) of the microcomputer can be reduced, and the cost of the microcomputer can be reduced.
[0022]
The present invention further includes means for holding a terminal to which a forced break is input at a first level which is either high or low when an external debug tool is not connected, and the central processing unit includes: When the terminal to which the forced break is input at the reset is the first level, the execution is started in the user mode, and the terminal to which the forced break is input at the reset is not the first level. Is characterized by starting execution in debug mode.
[0023]
According to the present invention, when an external debug tool is not connected, it is held at the first level indicating either high or low by pull-up or the like. Therefore, if the terminal to which the forced break is input is configured to be at a level opposite to the first level by connecting the debugging terminal, should the terminal be started in user mode at reset? It is possible to determine whether to start in debug mode.
[0024]
On the other hand, when an external debugging tool is connected, the debugging is being performed, so it is preferable to start the execution in the debugging mode at the time of resetting. Further, when the debug tool is not connected, it is preferable to start the execution in the user mode without the user being aware of it.
[0025]
According to the present invention, it is possible to start execution in an appropriate mode at the time of resetting with a simple configuration in which it is detected whether the debugging terminal is high or low, without the user being aware of it.
[0026]
An electronic apparatus according to the present invention includes any one of the microcomputers described above, 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.
[0027]
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.
[0028]
The present invention is also a debug system for a target system including a microcomputer, wherein the second monitor means performs 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. Monitor means, a user processing mode and a debugging mode are formed so as to be switchable. In the user mode, the primitive command is executed. The central processing unit is provided in a chip including the central processing unit. When a forcible break is input via a debugging terminal to which one communication line for performing two-way communication is connected and the debugging terminal, the central processing unit is switched from the user mode to the debugging mode. And switching means.
[0029]
According to the present invention, the instruction code size of the monitor program for executing the processing of the first monitoring means can be remarkably reduced. This makes it possible to increase the number of memory areas and terminals that can be freely used by the user. 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.
[0030]
DETAILED DESCRIPTION OF THE INVENTION
DESCRIPTION OF EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
[0031]
1. Features of this embodiment
First, features of the present embodiment will be described with reference to FIGS. 2A and 2B are diagrams showing a state in which the microcomputer 10 having the user mode and the debug mode and the debug tool 14 are connected.
[0032]
The microcomputer 10 includes a CPU (central processing unit) 12, an on-chip debugging unit 13, a forced break control unit 15, and a clock generation unit 17. The on-chip debug unit 13 transmits / receives debug information to / from the debug tool 14 in the debug mode, executes a debug program, and performs various debug processes.
[0033]
The microcomputer 10 includes SIOD 16 and BCLK 18 as debugging terminals. The SIOD 16 receives a forced break input signal in the user mode, and transmits / receives debug information to / from the external debug tool 14 by an asynchronous SIO in the debug mode. BCLK 18 is supplied by the clock generation unit 17 and is used as an asynchronous synchronous clock.
[0034]
By the way, transmission / reception with the external debugging tool 14 is performed only in the debugging mode, and this debugging terminal is not used in the user mode. On the other hand, the forced break input occurs only in the user mode because it is an input for switching from the user mode to the debug mode.
[0035]
Therefore, when the forced break control unit 15 receives a signal in the user mode, the forced break control unit 15 determines that a forced break has been input, and performs processing to switch the CPU 12 from the user mode to the debug mode (see FIG. 2A). . If a signal is received in the debug mode, it is determined as debug information, and the debug information is output to the on-chip debug unit 13 (see FIG. 2B).
[0036]
As described above, since the transmission / reception of debug information and the input of forced break occur only in different modes, even if the same terminal is shared as shown in FIGS. 2A and 2B, each can be distinguished and no confusion occurs. .
[0037]
Therefore, in the present embodiment, the SIOD 16 functions as a terminal for inputting a forced break input signal as shown in FIG. 2A in the user mode, and debug information as shown in FIG. 2B in the debug mode. It is configured to function as a terminal for performing transmission / reception.
[0038]
By doing so, the number of terminals required for debugging can be saved, and more terminals usable by the user can be secured.
[0039]
FIG. 3 is a timing chart showing the relationship between the forced break input and the state of the SIOD terminal.
[0040]
Reference numeral 16 'denotes SIOD of the output state on the debug tool 14 side, and 16 denotes SIOD of the input state on the microcomputer side. The debug tool outputs a high level signal during the user mode, and a low pulse is output in response to a forced break input from the outside (222). The microcomputer receives the low pulse and shifts from the user mode to the debug mode (228). The debug tool 14 outputs a high level signal for a certain period (224), and then starts communication of debug information in an asynchronous manner.
[0041]
4A and 4B are diagrams for explaining a second feature of the present embodiment. As shown in FIG. 4A, when the microcomputer 10 is not connected to the debugging tool, the SIOD terminal is pulled up to a high level. However, by connecting the debug tool 14 as shown in FIG. 4B, the SIOD terminal 16 can be set to an arbitrary level (high level or low level).
[0042]
In the present embodiment, by connecting the debug tool 14 to the microcomputer 10, a low level signal is output from the debug tool 14 so that the SIOD terminal 16 is at a low level.
[0043]
5A and 5B are diagrams for explaining the state of the SIOD terminal and the start mode at reset.
[0044]
As shown in FIG. 5A, when the SIOD is at the high level at the rise of the user RESET (230), the microcomputer starts execution in the user mode (232).
[0045]
As shown in FIG. 5B, when SIOD is at a low level at the rise of user RESET (234), the microcomputer starts execution in the debug mode (236). Therefore, the microcomputer shifts to the debug mode (238), and the debug tool side outputs a high level signal for a certain period (240), and then starts communication of debug information in an asynchronous manner (242).
[0046]
In this way, with a simple configuration of detecting whether the SIOD is at a high level or a low level at the time of user resetting, execution can be started in an appropriate mode at the time of resetting without the user being aware of it.
[0047]
Next, a third feature of the present embodiment will be described. This corresponds to the case where the on-chip debug unit 14 in FIGS. 2A and 2B has a function corresponding to the mini-monitor unit 314 described below.
[0048]
As shown in FIG. 6, in the present embodiment, the microcomputer 10 includes a CPU (central processing unit) 12 and a mini monitor unit (first monitor means) 314. A main monitor unit (second monitor means) 316 is provided outside the microcomputer 10. Here, the main monitor unit 316 performs processing for converting (decomposing) a debug command issued by, for example, the host system into a primitive command. The mini monitor unit 314 transmits and receives data to and from the main monitor unit 316. Then, the mini monitor unit 314 determines a primitive command to be executed based on the received data from the main monitor unit 316, and performs processing for executing the primitive command.
[0049]
Here, debug commands to be converted by the main monitor unit 316 include program load, GO, step execution, memory write, memory read, internal register write, internal register read, breakpoint setting, breakpoint release, etc. You can think of commands. The main monitor unit 316 sends these various complicated debug commands to, for example, GO, write (write to a given address on the memory map in the debug mode), and read (from a given address on the memory map). (Read), etc., to convert to simple and primitive commands. In this way, the instruction code size of the mini monitor program that performs the processing of the mini monitor unit 314 can be significantly reduced. Thereby, the on-chip debugging function of the microcomputer 10 can be realized.
[0050]
Normally, a debugging program has all processing routines for debugging commands such as program loading, GO, and step execution, so that it requires a large memory and is practically difficult to incorporate in a microcomputer.
[0051]
However, in the present embodiment, the mini-monitor program that performs processing of the mini-monitor unit 314 has only a simple primitive command processing routine such as GO, write, and read, and the instruction code size is very small (for example, 256 bytes). Therefore, the mini monitor program can be built in the microcomputer 10 and an on-chip debugging function can be realized. It is also possible to reduce the memory area that can be freely used by the user from the minimum to zero.
[0052]
2. Detailed configuration example
FIG. 7 shows a detailed configuration example of the microcomputer and the debug system of this embodiment. As shown in FIG. 7, the microcomputer 20 includes a CPU 22, a BCU (bus control unit) 26, an internal memory (an internal ROM and an internal RAM other than the mini monitor ROM 42 and the mini monitor RAM 44) 28, a clock generation unit 30, and a mini monitor unit 40 (first monitor). 1 monitoring means) and a trace unit 50.
[0053]
Here, the CPU 22 executes various instructions and includes an internal register 24. The internal registers 24 include general-purpose registers R0 to R15, special registers SP (stack pointer register), AHR (higher register of product-sum result data), ALR (lower register of product-sum result data), and the like. The CPU 22 has a user mode and a debug mode, and is configured to switch from the user mode to the debug mode when receiving a forced break input from the forced break control unit 49 via the line 51.
[0054]
The BCU 26 controls the bus. For example, a Harvard architecture bus 31 connected to the CPU 22, a bus 32 connected to the internal memory 28, an external bus 33 connected to the external memory 36, an internal connected to the mini monitor unit 40, the trace unit 50, and the like. The bus 34 is controlled. The clock generation unit 30 generates various clocks used in the microcomputer 20. The clock generation unit 30 also supplies a clock to the external debug tool 60 via BCLK.
[0055]
The mini monitor unit 40 includes a mini monitor ROM 42, a mini monitor RAM 44, a control register 46, an SIO 48, and a forced break control unit 49.
[0056]
Here, the mini monitor ROM 42 stores a mini monitor program. In the present embodiment, this mini monitor program only processes simple and primitive commands such as GO, read, and write. For this reason, the memory capacity of the mini-monitor ROM 42 can be suppressed to, for example, about 256 bytes, and the microcomputer 20 can be reduced in size while having an on-chip debugging function.
[0057]
The content of the internal register 24 of the CPU 22 is saved in the mini monitor RAM 44 when the mode is shifted to the debug mode (when a break of the user program occurs). As a result, the execution of the user program can be restarted properly after the debug mode ends. In addition, reading of the contents of the internal register can be realized by a primitive read command etc. possessed by the mini monitor program.
[0058]
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 CPU 22 operating by the mini-monitor program writing data to each bit of the control register 46 or reading the data of each bit.
[0059]
The SIO 48 controls data for debugging transmitted / received to / from a debugging tool 60 provided outside the microcomputer 20.
[0060]
The forced break control unit 49 and the debug tool 60 are connected by SIOD (data transmission / reception line), and the forced break input and debug information are transmitted / received.
[0061]
The forced break control unit 49 determines that a forced break has been input when receiving a signal in the user mode via the SIOD, and switches the CPU 12 from the user mode to the debug mode via the line 51. Process to send a signal. When a signal is received in the debug mode, it is determined that the information is debug information, and processing for outputting the debug information to the SIO 48 is performed.
[0062]
The trace unit 50 is for realizing a real-time trace function. The trace unit 50 and the debug tool 60 are connected by four lines of 3-bit DST [2: 0] representing the instruction execution state of the CPU 22 and DPCO representing the branch destination PC (program counter) value. Has been.
[0063]
The debug tool 60 includes a main monitor unit 62 and is connected to a host system 66 realized by a personal computer or the like. When the host system 66 issues a debug command such as program load or step execution by a user operation, the main monitor unit 62 performs processing for converting (decomposing) the debug command into a primitive command. When the main monitor unit 62 transmits data instructing execution of a primitive command to the mini-monitor unit 40, the mini-monitor unit 40 performs processing for executing the instructed primitive command.
[0064]
FIG. 8 shows an example of a memory map in the debug mode. As indicated by D1, D2, and D3 in FIG. 8, in the debug mode, the addresses of the control register 46, mini monitor RAM 44, and mini monitor ROM 42 in FIG. 7 are also allocated on the memory map.
[0065]
3. Conversion to primitive command
FIGS. 9A, 9B, 9C, and 9D schematically show processing for converting various debug commands into primitive commands.
[0066]
For example, as shown in FIG. 9A, 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.
[0067]
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 control register 46 in FIG. 7 (write command to the address D1 in FIG. 8) and a GO command. That is, the mini monitor program executes the primitive write command and the GO command, thereby realizing a step execution command.
[0068]
Assume that a debug command called an internal register read command is issued as shown in FIG. Then, this internal register read command is converted into a read command (read command from the address D2 in FIG. 8) from the mini monitor RAM (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.
[0069]
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 control register 46. That is, the breakpoint setting command is realized by the mini monitor program executing this primitive write command.
[0070]
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 mini monitor ROM 42 can be reduced, and an on-chip debugging function can be realized with a small hardware scale.
[0071]
4). SIO configuration example
FIG. 10 shows a configuration example of the SIO 48. The SIO 48 includes a transmission / reception buffer 70, a shift register 76, a transmission / reception switching unit 78, a clock control unit 80, and a control register 84.
[0072]
Here, the transmission / reception buffer 70 is for temporarily storing transmission data and reception data, and includes a transmission buffer 72 and a reception buffer 74. The shift register 76 has a function of converting transmission data from the transmission buffer 72 from parallel data to serial data and outputting it to the transmission / reception switching unit 78. Also, it has a function of converting received data from the transmission / reception switching unit 78 from serial data to parallel data and outputting it to the reception buffer 74. The transmission / reception switching unit 78 is for switching between transmission and reception of data. Thereby, half-duplex data transmission / reception using SIOD becomes possible.
[0073]
The clock control unit 80 divides BCLK by the built-in frequency dividing circuit 82, and outputs the sampling clock SMC 1 obtained by this frequency division to the shift register 76. The shift register 76 operates based on this SMC1. Further, since this BCLK is supplied to the debug tool 60, the BCLK is shared by the microcomputer 20 and the debug tool 60.
[0074]
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 CPU 22 writes a desired frequency dividing ratio in the control register 84, whereby the frequency dividing ratio in the frequency dividing circuit 82 is set.
[0075]
5. Debug tool configuration example
FIG. 11 shows a configuration example of the debug tool 60.
[0076]
The CPU 90 executes a program stored in the ROM 108 and controls the entire debug tool 60. The transmission / reception switching unit 92 is for switching between transmission and reception of data. The clock control unit 94 controls a clock supplied to the SCLK terminal of the CPU 90, the address up counter 100, and the trace memory 104. The clock control unit 94 receives BCLK from the microcomputer 20 (SIO 48). The clock control unit 94 includes a frequency detection circuit 95 and a frequency dividing circuit 96. The frequency detection circuit 95 detects the frequency range to which BCLK belongs and outputs the result to the control register 98. The frequency dividing ratio in the frequency dividing circuit 96 is controlled by the control register 98. That is, the main monitor program (stored in the main monitor ROM 110) executed by the CPU 90 reads the frequency range of BCLK from the control register 98. Then, the main monitor program determines an optimum frequency division ratio corresponding to this frequency range, and writes this frequency division ratio in the control register 98. Then, the frequency dividing circuit 96 divides BCLK by this frequency dividing ratio to generate SMC2, and outputs it to the SCLK terminal of the CPU 90.
[0077]
The address up counter 100 is for counting up the address of the trace memory. The selector 102 selects either the line 122 (address output from the address up counter 100) or the line 124 (address from the address bus 120), and outputs data to the address terminal of the trace memory 104. The selector 106 selects either the line 126 (DST [2: 0], DPCO which is the output of the trace unit 50 in FIG. 3) or the line 128 (data bus 118), and the data is input to the data terminal of the trace memory 104. Or retrieve data from the data terminal.
[0078]
The ROM 108 includes a main monitor ROM 110 (corresponding to the main monitor unit 62 in FIG. 3), and the main monitor ROM 110 stores a main monitor program. As described with reference to FIGS. 5A to 5D, the main monitor program performs processing for converting a debug command into a primitive command. The RAM 112 serves as a work area for the CPU 90.
[0079]
The RS232C interface 114 and the parallel interface 116 serve as an interface with the host system 66 of FIG. 3, and debug commands from the host system 66 are input to the CPU 90 via these interfaces. The clock generation unit 118 generates a clock for operating the CPU 90 and the like.
[0080]
6). Send and receive data
Now, as shown in FIG. 12A, as a method of communication of debug data between the mini monitor unit 40 and the main monitor unit 62, TXD (transmission) and RXD (reception) lines are provided separately, A method of communicating in duplex is conceivable.
[0081]
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
[0082]
Therefore, in the present embodiment, as shown in FIG. 12B, a single TXD / RXD line (bidirectional communication line) is provided between the mini monitor unit 40 and the main monitor unit 62, and a half duplex bidirectional operation is performed. Communicate. In this embodiment, this line is shared with SIOD for inputting a forced break. For this reason, the increase in the number of terminals of the microcomputer can be minimized, and the cost of the microcomputer can be reduced.
[0083]
Further, in the present embodiment, as shown in FIG. 12C, the processing corresponding to the received data is performed on condition that the mini-monitor unit 40 serving as the slave has received data from the main monitor unit 62 serving as the master. The response data corresponding to the received data is transmitted to the main monitor unit 62. That is, when the main monitor unit 62 transmits data (command) to the mini-monitor unit 40, the mini-monitor unit 40 in the wait state receives this, and performs processing corresponding to the received data. Then, data (reply) corresponding to the received data is transmitted to the main monitor unit 62. Thereafter, the mini monitor unit 40 waits until data is received from the main monitor unit 62. That is, the mini monitor unit 40 stops operating until data is received from the main monitor unit 62, and starts operating on the condition that the data has been received. In this way, data can be properly transmitted and received while the communication line between the mini monitor unit 40 and the main monitor unit 62 is single.
[0084]
7). Detailed processing example of the mini monitor
Next, a detailed processing example of the mini monitor unit will be described.
[0085]
As shown in FIG. 13, 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.
[0086]
FIGS. 14 and 15 are flowcharts showing the processing of the mini monitor program in the debug mode.
[0087]
When shifting to the debug mode, the mini-monitor program first saves the contents of the internal register 24 of the CPU 22 in FIG. 7 to the monitor RAM 44 (step S1). Then, setting processing of the control register 46 used by the mini monitor program is performed (step S2).
[0088]
Next, the 14-byte data received from the debug tool 60 is written to the reception buffer 74 (see FIG. 10) (step S3). Then, the first byte (command identification data ID) of the data in the reception buffer 74 is checked (step S4).
[0089]
Then, as shown in FIG. 13, when the ID indicates a read command, 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 S3 in FIG.
[0090]
If the ID indicates a write command, 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).
[0091]
If the ID indicates an external routine jump command, 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).
[0092]
If the ID indicates a GO command, the data saved in the monitor RAM 44 is restored to the internal register 24 (steps S15 and S16). Then, as shown in FIG. 13, the process returns to the user program and exits from the debug mode (step S17).
[0093]
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. 15, the processing of the data fill command is omitted.
[0094]
As described above, the primitive command obtained by converting the debug command is executed by the mini monitor program.
[0095]
8). Electronics
Next, an electronic apparatus including the microcomputer according to this embodiment will be described.
[0096]
For example, FIG. 16A shows an internal block diagram of a car navigation system which is one of electronic devices, and FIG. 17A shows an external view thereof. The operation of the car navigation system is performed using the remote controller 510, and the position detection unit 520 detects the position of the vehicle based on information from the GPS and the gyro. Information such as a map is stored in a CDROM 530 (information storage medium). The image memory 540 is a memory serving as a work area for image processing, and the generated image is displayed to the driver using the image output unit 550. The microcomputer 500 receives data from a data input source such as the remote controller 510, the position detection unit 520, and the CDROM 530, performs various processes, and outputs the processed data using an output device such as the image output unit 550.
[0097]
FIG. 16B shows an internal block diagram of a game device which is one of electronic devices, and FIG. 17B shows an external view thereof. In this game apparatus, based on the operation information of the player from the game controller 560, the game program from the CD ROM 570, the player information from the IC card 580, and the like, a game image and game sound are generated using the image memory 590 as a work area. Output is performed using the output unit 610 and the sound output unit 600.
[0098]
FIG. 16C shows an internal block diagram of a printer which is one of electronic devices, and FIG. 17C shows an external view thereof. In this printer, based on the operation information from the operation panel 620 and the character information from the code memory 630 and the font memory 640, a print image is generated using the bitmap memory 650 as a work area and is output using the print output unit 660. . The printer status and mode are communicated to the user using the display panel 670.
[0099]
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. 16A to 17C 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, it becomes possible that the user does not use any memory area used for storing the program and various data.
[0100]
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.
[0101]
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.
[0102]
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an example of a CPU replacement type ICE.
FIGS. 2A and 2B are diagrams for explaining the features of the present embodiment. FIGS.
FIG. 3 is a timing chart showing the relationship between forced break input and the state of a SIOD terminal.
4A and 4B are diagrams for explaining a second feature of the present embodiment. FIG.
FIGS. 5A and 5B are diagrams for explaining a state of a SIOD terminal and a start mode at reset.
FIG. 6 is a diagram for explaining a third feature of the present embodiment.
FIG. 7 is a functional block diagram illustrating a configuration example of a microcomputer and a debugging system according to the present embodiment.
FIG. 8 is a diagram showing a memory map in a debug mode.
FIGS. 9A, 9B, 9C, and 9D are diagrams for explaining processing for converting (decomposing) a debug command into a primitive command.
FIG. 10 is a functional block diagram illustrating a configuration example of an SIO.
FIG. 11 is a functional block diagram illustrating a configuration example of a debug tool.
FIGS. 12A, 12B, and 12C are diagrams for explaining a communication method between a mini-monitor unit and a main monitor unit.
FIG. 13 is a diagram for explaining a transition from a user program execution mode to a debug mode.
FIG. 14 is a flowchart for explaining a detailed processing example of the present embodiment;
FIG. 15 is a flowchart for explaining a detailed processing example of the present embodiment;
16A, 16B, and 16C are examples of internal block diagrams of various electronic devices.
17A, 17B, and 17C are examples of external views of various electronic devices.
[Explanation of symbols]
10 Microcomputer
12 CPU (Central Processing Unit)
13 On-chip debug section
14 Debug Tool
15 Forced break control unit
16 SIOD
17 Clock controller
18 BCLK
20 Microcomputer
22 CPU (Central Processing Unit)
24 Internal registers
26 BCU (Bus Control Unit)
28 Internal memory
30 Clock generator
31 bus
32 buses
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
49 Forced break controller
50 Trace part
60 Debug Tool
62 Main monitor section (second monitor means)
66 Host system
70 Send / Receive buffer
72 Transmission buffer
74 Receive buffer
76 Shift register
78 Transmission / reception switching unit
80 Clock controller
82 divider circuit
84 Control register
90 CPU
92 Transmission / reception switching unit
94 Clock controller
95 Frequency detector
96 divider 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 generator
316 Main monitor section (second monitor means)

Claims (4)

ユーザープログラムが実行されるユーザーモード及びデバッグコマンドが実行されるデバッグモードを有し、デバッグモードにおいてはマイクロコンピュータの外部に設けられ、予め記憶されたデバッグコマンドとGO、ライト、リード等の2つ以上のプリミティブコマンドの組み合わせの対応付けに従ってホストシステムが発行したデバッグコマンドをGO、ライト、リード等の2つ以上のプリミティブコマンドの組み合わせに変換するための処理を行う第2のモニタ手段との間でデータを送受信するように構成されたマイクロコンピュータであって、
ユーザーモード及びデバッグモードが切り替え可能に形成された中央処理ユニットと、
デバッグモードにおいてオンチップデバッグを行うための処理を行う第1のモニタ手段と、
オンチップデバッグを行うためのデータを外部の第2のモニタ手段と半2重の双方向通信で送受信を行うための1本の通信ラインが接続されるデバッグ用端子と、
ユーザーモード時に前記デバッグ用端子を介して所定のレベルの信号を受けると、強制ブレークの入力があったものと判断し、ユーザーモードからデバッグモードへ切り替えるための強制ブレーク信号を中央処理ユニットに送る強制ブレーク処理部と、を含み、
前記第1のモニタ手段は、
GO、ライト、リード等のプリミティブコマンドを処理を行うためのミニモニタプログラムが格納されたメモリと、
デバッグモードにおいてマイクロコンピュータの外部に設けられた第2のモニタ手段からGO、ライト、リード等のプリミティブコマンドの実行を指示する実行指示データを受信するとメモリに格納されたミニモニタプログラムを起動して前記実行指示データによって指示されたプリミティブコマンドを実行するための処理を行う手段を含み、
前記中央処理ユニットは、
前記強制ブレーク信号を受けるとユーザーモードからデバッグモードに切り替わり、デバッグモードにおいてはミニモニタプログラムが格納されたメモリがメモリマップに割り付けられ、ミニモニタプログラムを実行してGO、ライト、リード等のプリミティブコマンドの処理を行うことを特徴とするマイクロコンピュータ。
There are a user mode in which a user program is executed and a debug mode in which a debug command is executed. In the debug mode, two or more such as a debug command stored in advance and a GO, a write, and a read are stored outside the microcomputer. Data with the second monitoring means for performing processing for converting the debug command issued by the host system into a combination of two or more primitive commands such as GO, write, and read in accordance with the correspondence of the combination of primitive commands A microcomputer configured to transmit and receive
A central processing unit formed to be switchable between user mode and debug mode;
First monitoring means for performing processing for performing on-chip debugging in debug mode;
A debugging terminal to which one communication line for transmitting / receiving data for performing on-chip debugging to / from external second monitoring means by half-duplex bidirectional communication is connected;
When a signal of a predetermined level is received through the debugging terminal in the user mode, it is determined that a forced break has been input, and a forced break signal for switching from the user mode to the debug mode is sent to the central processing unit. A break processing unit,
The first monitoring means includes
A memory storing a mini-monitor program for processing primitive commands such as GO, write, and read;
When execution instruction data for instructing execution of primitive commands such as GO, write, and read is received from the second monitor means provided outside the microcomputer in the debug mode, the mini monitor program stored in the memory is activated to Means for performing processing for executing a primitive command instructed by the execution instruction data;
The central processing unit is
When the forced break signal is received, the mode is switched from the user mode to the debug mode. In the debug mode, the memory storing the mini monitor program is allocated to the memory map, and the mini monitor program is executed to execute primitive commands such as GO, write, and read. The microcomputer which performs the process of.
請求項1において、
外部のデバッグツールが接続されていない状態には前記デバッグ用端子をハイ又はローのいずれかである第一のレベルに保持する回路を含み、
前記中央処理ユニットは、
リセット時に前記デバッグ用端子が前記第一のレベルであることを検出するとユーザーモードで実行を開始し、リセット時に前記デバッグ用端子が前記第一のレベルでないことを検出するとデバッグモードで実行を開始するように構成されていることを特徴とするマイクロコンピュータ。
In claim 1,
In a state where no external debugging tool is connected, a circuit for holding the debugging terminal at a first level which is either high or low,
The central processing unit is
When it is detected that the debug terminal is at the first level at reset, execution starts in the user mode, and when it is detected at reset that the debug terminal is not at the first level, execution is started in debug mode. The microcomputer is configured as described above.
請求項1乃至2のいずれかのマイクロコンピュータと、
前記マイクロコンピュータの処理対象となるデータの入力源と、
前記マイクロコンピュータにより処理されたデータを出力するための出力装置とを含むことを特徴とする電子機器。
A microcomputer according to claim 1;
An input source of data to be processed by the microcomputer;
And an output device for outputting data processed by the microcomputer.
マイクロコンピュータを含むターゲットシステムのためのデバッグシステムであって、
予め記憶されたデバッグコマンドとGO、ライト、リード等の2つ以上のプリミティブコマンドの組み合わせの対応付けに従ってホストシステムが発行したデバッグコマンドをGO、ライト、リード等の2つ以上のプリミティブコマンドの組み合わせに変換するための処理を行う第2のモニタ手段と、
ユーザーモード及びデバッグモードが切り替え可能に形成された中央処理ユニットと、
デバッグモードにおいてオンチップデバッグを行うための処理を行う第1のモニタ手段と、
オンチップデバッグを行うためのデータを外部の第2のモニタ手段と半2重の双方向通信で送受信を行うための1本の通信ラインが接続されるデバッグ用端子と、
ユーザーモード時に前記デバッグ用端子を介して所定のレベルの信号を受けると、強制ブレークの入力があったものと判断し、ユーザーモードからデバッグモードへ切り替えるための強制ブレーク信号を中央処理ユニットに送る強制ブレーク処理部と、を含み、
前記第1のモニタ手段は、
GO、ライト、リード等のプリミティブコマンドを処理を行うためのミニモニタプログラムが格納されたメモリと、
デバッグモードにおいてマイクロコンピュータの外部に設けられた第2のモニタ手段からGO、ライト、リード等のプリミティブコマンドの実行を指示する実行指示データを受信するとメモリに格納されたミニモニタプログラムを起動して前記実行指示データによって指示されたプリミティブコマンドを実行するための処理を行う手段を含み、
前記中央処理ユニットは、
前記強制ブレーク信号を受けるとユーザーモードからデバッグモードに切り替わり、デバッグモードにおいてはミニモニタプログラムが格納されたメモリがメモリマップに割り付けられ、ミニモニタプログラムを実行してGO、ライト、リード等のプリミティブコマンドの処理を行うことを特徴とするデバッグシステム。
A debugging system for a target system including a microcomputer,
A debug command issued by the host system in accordance with a combination of a pre-stored debug command and a combination of two or more primitive commands such as GO, write, and read is converted into a combination of two or more primitive commands such as GO, write, and read. Second monitoring means for performing processing for conversion;
A central processing unit formed to be switchable between user mode and debug mode;
First monitoring means for performing processing for performing on-chip debugging in debug mode;
A debugging terminal to which one communication line for transmitting / receiving data for performing on-chip debugging to / from external second monitoring means by half-duplex bidirectional communication is connected;
When a signal of a predetermined level is received through the debugging terminal in the user mode, it is determined that a forced break has been input, and a forced break signal for switching from the user mode to the debug mode is sent to the central processing unit. A break processing unit,
The first monitoring means includes
A memory storing a mini-monitor program for processing primitive commands such as GO, write, and read;
When execution instruction data for instructing execution of primitive commands such as GO, write, and read is received from the second monitor means provided outside the microcomputer in the debug mode, the mini monitor program stored in the memory is activated to Means for performing processing for executing a primitive command instructed by the execution instruction data;
The central processing unit is
When the forced break signal is received, the mode is switched from the user mode to the debug mode. In the debug mode, the memory storing the mini monitor program is allocated to the memory map, and the mini monitor program is executed to execute primitive commands such as GO, write, and read. A debugging system characterized by performing the above process.
JP10372098A 1998-03-31 1998-03-31 Microcomputer, electronic equipment and debugging system Expired - Fee Related JP3741182B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10372098A JP3741182B2 (en) 1998-03-31 1998-03-31 Microcomputer, electronic equipment and debugging system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10372098A JP3741182B2 (en) 1998-03-31 1998-03-31 Microcomputer, electronic equipment and debugging system

Publications (2)

Publication Number Publication Date
JPH11282719A JPH11282719A (en) 1999-10-15
JP3741182B2 true JP3741182B2 (en) 2006-02-01

Family

ID=14361532

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10372098A Expired - Fee Related JP3741182B2 (en) 1998-03-31 1998-03-31 Microcomputer, electronic equipment and debugging system

Country Status (1)

Country Link
JP (1) JP3741182B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298587B2 (en) 2012-05-22 2016-03-29 Samsung Electronics Co., Ltd. Integrated circuit including clock controlled debugging circuit and system-on-chip including the same

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002304310A (en) * 2001-04-06 2002-10-18 Fujitsu Ltd Semiconductor integrated circuit
JP2006268727A (en) 2005-03-25 2006-10-05 Seiko Epson Corp Integrated circuit device, debug system, microcomputer and electronic device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298587B2 (en) 2012-05-22 2016-03-29 Samsung Electronics Co., Ltd. Integrated circuit including clock controlled debugging circuit and system-on-chip including the same

Also Published As

Publication number Publication date
JPH11282719A (en) 1999-10-15

Similar Documents

Publication Publication Date Title
JP3684832B2 (en) Microcomputer, electronic equipment and debugging system
US6922795B2 (en) Microcomputer, electronic equipment, and debugging system
JP3313007B2 (en) Microcomputer
JP3671667B2 (en) Microcomputer, electronic equipment and debugging system
US7584381B2 (en) Semiconductor integrated circuit device, debug system, microcomputer, and electronic apparatus
JP3666237B2 (en) Information processing apparatus and electronic apparatus
US20080010541A1 (en) Integrated circuit device, debugging tool, debugging system, microcomputer, and electronic instrument
US20060206763A1 (en) Debugging system, semiconductor integrated circuit device, microcomputer, and electronic apparatus
US20030191624A1 (en) Debug function built-in type microcomputer
JPH10116187A (en) Microcomputer
US20070250740A1 (en) System and method for conducting BIST operations
JP3741182B2 (en) Microcomputer, electronic equipment and debugging system
JP3380827B2 (en) Emulator device
US20050086454A1 (en) System and methods for providing a debug function built-in type microcomputer
JP2005251217A (en) Microcomputer, electronic equipment and debugging system
JPH1083318A (en) Electronic circuit analyzer
JP2006235695A (en) Target system, debug system, integrated circuit device, microcomputer and electronic device
KR100531729B1 (en) Apparatus for interface pheriperal device with PC using parallel port and method thereof
US5680646A (en) Input/output control system
WO2006070939A1 (en) Program executed under control of operating system providing kernel mode and user mode
JP2007193570A (en) Microcomputer and electronic equipment
JP2007034881A (en) Semiconductor integrated circuit
JP2003263336A (en) Microcomputer with built-in debug function
JP2000181743A (en) Electronic circuit analysis device, its analysis method, and storage medium
JP2006331147A (en) Microcomputer, and debugging system and method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050118

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050510

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050711

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050803

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050922

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20051019

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051101

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091118

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees