JP4044455B2 - Debug support device - Google Patents
Debug support device Download PDFInfo
- Publication number
- JP4044455B2 JP4044455B2 JP2003040212A JP2003040212A JP4044455B2 JP 4044455 B2 JP4044455 B2 JP 4044455B2 JP 2003040212 A JP2003040212 A JP 2003040212A JP 2003040212 A JP2003040212 A JP 2003040212A JP 4044455 B2 JP4044455 B2 JP 4044455B2
- Authority
- JP
- Japan
- Prior art keywords
- memory space
- debug
- access
- switching
- user
- 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 - Lifetime
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、マイクロコンピュータに搭載されるデバッグサポート装置に関する。
【0002】
マイクロコンピュータには、マイクロコンピュータで実行されるファームウェア等のプログラムのデバッグ作業をおこなうために、デバッグサポート装置が搭載されることがある。このようなマイクロコンピュータは、デバッグ対象プログラムを格納し、またその実行時に作業領域となるユーザメモリ空間と、デバッグ処理をおこなうための割り込み処理プログラムを格納するデバッグメモリ空間を備えている。そして、デバッグ中に、CPU(中央処理装置)は、ユーザメモリ空間とデバッグメモリ空間の両方にアクセスする。
【0003】
【従来の技術】
図6は、従来のデバッグサポート装置搭載マイクロコンピュータの概略構成を機能的に示すブロック図である。図6に示すように、従来は、ユーザメモリ空間4とデバッグメモリ空間7との切り替え要因を検出する機能を実現するメモリ空間切り替え要因検出部2と、メモリ空間の切り替えを制御する機能を実現するメモリ空間切り替え制御部3は、CPU1に設けられている。
【0004】
したがって、現在のメモリ空間がユーザメモリ空間4にあるときに、CPU1がブレイクポイント検出、未定義命令フェッチ検出またはステップ実行ブレイクをおこなうと、CPU1は強制割り込み処理を開始する。それによって、デバッグサポート装置5のメモリ空間切り替え回路6を介して、メモリ空間がデバッグメモリ空間7に切り替えられる。
【0005】
一方、現在のメモリ空間がデバッグメモリ空間7にあるときに、CPU1は、RETI命令(リターンインタラプト命令)フェッチを検出すると、メモリ空間をユーザメモリ空間4に切り替える。それと同時に、CPU1は、RETI命令を実行し、ユーザメモリ空間4からデバッグメモリ空間7へ移行するときの強制割り込みに対する復帰をおこなう。
【0006】
また、従来のデバッグサポート装置搭載マイクロコンピュータでは、デバッグメモリ空間からユーザメモリ空間へアクセスをおこなう際には、ワンショットのメモリ空間切り替え信号が発生する。そのため、メモリ空間切り替え信号が発生したつぎのアクセスに限って、デバッグメモリ空間からユーザメモリ空間へアクセスすることができる。
【0007】
また、デバッグサポート装置に関して、被デバッグシステムとデバッグサポートシステムとの間のメモリ空間の切り替えをおこなう技術が公知である(特許文献1参照)。また、インサーキットエミュレータを用いてバンクメモリ上に配置されたソフトウェアのデバッグをおこなう技術が公知である(特許文献2参照)。
【0008】
【特許文献1】
特開平2−28732号公報
【特許文献2】
特開平5−113906号公報
【0009】
【発明が解決しようとする課題】
しかしながら、従来のデバッグサポート装置搭載マイクロコンピュータ(以下、評価用マイコンとする)のCPUは、メモリ空間を切り替えるための多機能化により、デバッグサポート装置を搭載しないマイクロコンピュータ(以下、量産用マイコンとする)のCPUと比較して、ゲート数が多くなり、面積が大きくなる。したがって、評価用マイコン向けのCPUと量産用マイコン向けのCPUとでは互換性がなくなるため、それらを別々に用意しなければならないという問題点がある。
【0010】
また、従来の評価用マイコンでは、デバックメモリ空間からユーザメモリ空間へのバスのデータ幅を超えるデータアクセスを1命令でおこなうことができない。たとえば8ビットのバス幅に対して、CPUが、16ビットデータのリードまたはライトをおこなう場合には、ワンショットで1回目のユーザメモリ空間への切り替えをおこない、最初の8ビットデータをユーザメモリ空間へアクセスした後、つづくワンショットで2回目のユーザメモリ空間への切り替えおよび残りの8ビットデータのアクセスをおこなうことになる。そのため、デバッグメモリ空間からユーザメモリ空間へのアクセス効率が悪いという問題点がある。
【0011】
本発明は、上記問題点に鑑みてなされたものであって、CPUの代わりに、デバッグ中のメモリ空間切り替え要因の検出と、メモリ空間の切り替え制御をおこなうことが可能なデバッグサポート装置を提供することを目的とする。また、本発明は、デバッグ中にユーザメモリ空間への連続するデータアクセスを可能とするデバッグサポート装置を提供することを目的とする。
【0012】
【課題を解決するための手段】
上記目的を達成するため、本発明にかかるデバッグサポート装置は、未定義命令フェッチまたはブレイクポイントを検出するメモリ空間切り替え要因検出手段と、未定義命令フェッチもしくはブレイクポイントの検出時にメモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える際の切り替えを制御するメモリ空間切り替え制御手段を有することを特徴とする。また、メモリ空間切り替え制御手段は、ステップ実行ブレイク許可時には、一命令実行ごとにメモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える。そして、メモリ空間をデバッグメモリ空間に切り替える際に、デバッグサポート装置は、CPUに対する強制割り込みを発生する。
【0013】
この発明によれば、デバッグサポート装置は、CPUの代わりに、メモリ空間切り替え要因を検出して、メモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替えることができる。
【0014】
この発明において、メモリ空間切り替え要因検出手段はRETI命令フェッチを検出し、その検出時に、メモリ空間切り替え制御手段がメモリ空間をデバッグメモリ空間からユーザメモリ空間へ切り替える構成としてもよい。この場合には、デバッグサポート装置は、CPUの代わりに、RETI命令フェッチを検出して、メモリ空間をデバッグメモリ空間からユーザメモリ空間へ切り替えることができる。
【0015】
また、上記目的を達成するため、本発明にかかるデバッグサポート装置は、デバッグメモリ空間からユーザメモリ空間へのアクセスが許可されているときにセットされるレジスタを有し、このレジスタがセットされている間、CPUのアクセスがデータアクセスであればメモリ空間がユーザメモリ空間であることを示す信号を出力し、CPUのアクセスがオペコードフェッチもしくはオペランドフェッチであればメモリ空間がデバッグメモリ空間であることを示す信号を出力するメモリ空間制御手段を有することを特徴とする。そして、前記レジスタは、メモリ空間を示す信号がユーザメモリ空間を示す状態からデバッグメモリ空間を示す状態に切り替わったときにクリアされる。
【0016】
この発明によれば、デバッグ中に、CPUのアクセスがデータアクセスである限り、メモリ空間がユーザメモリ空間となるので、ユーザメモリ空間への連続するデータアクセスが可能となる。
【0017】
【発明の実施の形態】
以下に、本発明の実施の形態について図面を参照しつつ詳細に説明する。
【0018】
(実施の形態1)
図1は、本発明の実施の形態1にかかるデバッグサポート装置によるデバッグ環境の概略構成を機能的に示すブロック図である。図1において、CPU11、メモリ空間切り替え要因検出部12、メモリ空間切り替え制御部13、ユーザメモリ空間14、デバッグサポート装置15、メモリ空間切り替え回路16およびデバッグメモリ空間17は、評価用マイコンの構成要素である。
【0019】
メモリ空間切り替え要因検出部12とメモリ空間切り替え制御部13は、デバッグサポート装置15に実装されている。したがって、実施の形態1では、CPU11は、メモリ空間の切り替え要因を検出する機能、およびメモリ空間の切り替えを制御する機能を備えていない。これらの機能は、デバッグサポート装置15により実現される。
【0020】
図2は、デバッグサポート装置15の詳細な構成を機能的に示すブロック図である。図2に示すように、メモリ空間切り替え要因検出部12は、ブレイク制御部21および複数の比較器22a,22b,22c,22dを備えている。なお、図2に4個の比較器を示したが、比較器の数は、アドレスブレイク、命令ブレイク、オペランドブレイクまたはデータブレイクなどのブレイク要因の数に応じて増減し、2個、3個または5個以上でもよい。以下の説明では、便宜上、第1の比較器22a、第2の比較器22b、第3の比較器22c、第4の比較器22dとする。
【0021】
メモリ空間切り替え要因検出部12は、CPU11がメモリ空間切り替え回路16を介してユーザメモリ空間14またはデバッグメモリ空間17に対しておこなうアクセスを常に監視している。そして、第1の比較器22a、第2の比較器22b、第3の比較器22cおよび第4の比較器22dは、種々のブレイクポイントのコードおよびRETI命令のコードのうち、それぞれに割り当てられたコードと、CPU11によりフェッチされたコードとの比較をおこなう。
【0022】
ここで、図2では、各比較器22a,22b,22c,22dにおいて、CPU11のフェッチコードに対する比較対象を明示するため、種々のブレイクポイントのコードを、対応する第1〜第3の比較器22a,22b,22cから抜き出して、ブレイク要因0、ブレイク要因1およびブレイク要因nとして示している。また、RETI命令のコードも、対応する第4の比較器22dから抜き出して明示している。
【0023】
ブレイク制御部21は、第1〜第3の比較器22a,22b,22cのいずれかにおいてCPU11のフェッチコードとブレイクポイントのコードが一致したとき、すなわちブレイクポイントが検出されたときに、CPU11に強制割り込みをかける。また、ブレイク制御部21は、ステップ実行ブレイクが許可されているときには、ユーザメモリ空間14で一命令を実行するごとに、CPU11に強制割り込みをかける。
【0024】
また、ブレイク制御部21は、CPU11が未定義命令をフェッチしたときにも、CPU11に強制割り込みをかける。未定義命令フェッチの検出は、メモリ空間切り替え要因検出部12によりおこなわれるが、この検出機能を実現する構成については、図示省略する。
【0025】
メモリ空間切り替え制御部13は、強制割り込み/割り込み復帰検出部25および割り込み処理/復帰処理シーケンス制御部26を備えている。強制割り込み/割り込み復帰検出部25は、ブレイク制御部21によりCPU11に強制割り込みがかけられたことの検出をおこなう。また、強制割り込み/割り込み復帰検出部25は、第4の比較器22dにおいてCPU11のフェッチコードとRETI命令のコードが一致したことの検出をおこなう。
【0026】
割り込み処理/復帰処理シーケンス制御部26は、強制割り込み/割り込み復帰検出部25によりCPU11に対する強制割り込みの発生が検出されると、メモリ空間をユーザメモリ空間14からデバッグメモリ空間17へ切り替えるためのシーケンス制御をおこなう。また、割り込み処理/復帰処理シーケンス制御部26は、強制割り込み/割り込み復帰検出部25によりRETI命令が検出されると、メモリ空間をデバッグメモリ空間17からユーザメモリ空間14へ切り替えるためのシーケンス制御をおこなう。
【0027】
メモリ空間切り替え回路16は、割り込み処理/復帰処理シーケンス制御部26のシーケンス制御に基づいて、メモリ空間の切り替えをおこなう。CPU11は、強制割り込みが発生すると、割り込み処理をおこなう。また、CPU11は、RETI命令を実行し、強制割り込みに対する復帰処理をおこなう。
【0028】
つぎに、図2に示す装置の動作について説明する。現在のメモリ空間がユーザメモリ空間14にある場合に、メモリ空間切り替え要因検出部12は、CPU11が未定義命令フェッチまたはブレイクポイントのアクセスをおこなったことを検出すると、CPU11に対して強制割り込みを発生する。それによって、CPU11は割り込み処理を開始する。また、メモリ空間切り替え制御部13は、CPU11に対する強制割り込みの発生が通知されると、メモリ空間切り替え回路16に、メモリ空間をデバッグメモリ空間17へ切り替える信号を出力する。それによって、メモリ空間がデバッグメモリ空間17へ切り替えられる。
【0029】
ステップ実行ブレイクが許可されている場合には、メモリ空間切り替え要因検出部12は、ユーザメモリ空間14で一命令を実行するごとにCPU11に対する強制割り込みを発生する。それによって、CPU11は、一命令実行ごとに割り込み処理をおこなう。また、メモリ空間切り替え制御部13は、一命令実行ごとにメモリ空間切り替え回路16に、メモリ空間をデバッグメモリ空間17へ切り替える信号を出力する。それによって、メモリ空間が一命令ごとにデバッグメモリ空間17へ切り替えられる。
【0030】
一方、現在のメモリ空間がデバッグメモリ空間17にある場合に、メモリ空間切り替え要因検出部12は、CPU11がRETI命令フェッチをおこなったことを検出すると、それをメモリ空間切り替え制御部13に通知する。その通知に基づいて、メモリ空間切り替え制御部13は、メモリ空間切り替え回路16に、メモリ空間をユーザメモリ空間14へ切り替える信号を出力する。それによって、メモリ空間がユーザメモリ空間14へ切り替えられる。それと同時に、CPU11はRETI命令を実行し、ユーザメモリ空間14からデバッグメモリ空間17へ移行するときの強制割り込みに対する復帰処理をおこなう。
【0031】
上述した実施の形態1によれば、デバッグサポート装置15に、メモリ空間を切り替える要因を検出する機能と、メモリ空間の切り替えを制御する機能が実装されているので、CPUに代わって、デバッグサポート装置15によりメモリ空間の切り替えをおこなうことができる。したがって、CPU11を多機能化、多ゲート化および大型化することなく、評価用マイコンを構成することができるので、評価用マイコン向けのCPU11と量産用マイコン向けのCPUとで互換性をもたせることができる。たとえば、8ビットのCPUの場合には、定義するブレイク要因の数にもよるが、CPUのゲート面積を従来に比べておおよそ1〜2割程度改善することができる。
【0032】
(実施の形態2)
図3は、本発明の実施の形態2にかかるデバッグサポート装置によるデバッグ環境の概略構成を機能的に示すブロック図である。図3において、CPU31、ユーザメモリ空間34、デバッグサポート装置35、メモリ空間切り替え回路36、デバッグメモリ空間37、メモリ空間制御部38、ユーザメモリ空間アクセス制御部41およびメモリ空間制御部本体42は、評価用マイコンの構成要素である。
【0033】
メモリ空間制御部38は、デバッグサポート装置35に実装されている。ユーザメモリ空間アクセス制御部41およびメモリ空間制御部本体42は、メモリ空間制御部38に実装されている。ユーザメモリ空間アクセス制御部41は、デバッグ中にユーザメモリ空間34への連続するデータアクセスをおこなう機能を実現する。
【0034】
メモリ空間制御部本体42は、メモリ空間がユーザメモリ空間34にある場合に、デバッグメモリ空間切り替え要因検出後にメモリ空間をデバッグメモリ空間37へ切り替える。また、メモリ空間制御部本体42は、メモリ空間がデバッグメモリ空間37にある場合には、ユーザメモリ空間切り替え要因検出後にメモリ空間をユーザメモリ空間34へ切り替える。
【0035】
図4は、デバッグサポート装置のメモリ空間制御部38の詳細な構成を機能的に示すブロック図である。図4に示すように、ユーザメモリ空間アクセス制御部41は、セレクタ51、ユーザメモリ空間アクセス許可ビット52および立ち上がり検出器53を備えている。
【0036】
セレクタ51は、ユーザメモリ空間アクセス許可ビット52の値がゼロのときに、メモリ空間切り替え回路36に、メモリ空間を示す信号(メモリ空間信号)としてメモリ空間制御部本体42の出力信号を供給する。また、セレクタ51は、ユーザメモリ空間アクセス許可ビット52の値が1のときに、メモリ空間切り替え回路36に、メモリ空間信号としてオペコード信号またはオペランド信号を供給する。
【0037】
ここで、メモリ空間制御部本体42の出力信号は、ゼロの場合にユーザメモリ空間34を示し、1の場合にデバッグメモリ空間37を示す。また、オペコード信号またはオペランド信号は、CPU31のアクセスがオペコードフェッチまたはオペランドフェッチの場合に1となり、CPU31のアクセスがデータアクセスの場合にゼロとなる。CPU31のアクセスがオペコードフェッチまたはオペランドフェッチの場合のメモリ空間は、デバッグメモリ空間37である。CPU31のアクセスがデータアクセスの場合のメモリ空間は、ユーザメモリ空間34である。
【0038】
ユーザメモリ空間アクセス許可ビット52は、デバッグメモリ空間37からユーザメモリ空間34へのアクセスを許可するビットであり、CPU31によりセットされる。このユーザメモリ空間アクセス許可ビット52がセットされる、すなわちユーザメモリ空間アクセス許可ビット52の値が1であると、つぎのデータアクセスをユーザメモリ空間34へおこなうことが許可される。ユーザメモリ空間アクセス許可ビット52は、デバッグサポート装置35内のレジスタに設けられており、デバッグメモリ空間37の一部を構成するが、これについては、図3では省略している。
【0039】
ユーザメモリ空間アクセス許可ビット52は、セレクタ51から出力されたメモリ空間信号がゼロから1へ変化したときに、クリアされ、ゼロに戻る。立ち上がり検出器53は、セレクタ51から出力されたメモリ空間信号がゼロから1へ変化したことの検出をおこなう。
【0040】
つぎに、図4に示す装置の動作について説明する。現在のメモリ空間がデバッグメモリ空間37にある場合に、ユーザメモリ空間アクセス許可ビット52をセットすると、セレクタ51から出力されるメモリ空間信号は、メモリ空間制御部本体42の出力信号から、オペコード信号またはオペランド信号へ切り替わる。
【0041】
その後、CPU31がおこなうアクセスがデータの場合には、メモリ空間はユーザメモリ空間34となり、セレクタ51から出力されるメモリ空間信号はゼロである。したがって、立ち上がり検出器53がメモリ空間信号の立ち上がりを検出しないので、ユーザメモリ空間アクセス許可ビット52はクリアされずに、セットされたままである。
【0042】
この状態で、CPU31がつづいてデータアクセスをおこなうと、メモリ空間はユーザメモリ空間34となる。このように、CPU31がつぎにオペコードまたはオペランドをアクセスするまで、メモリ空間はユーザメモリ空間34となり、CPU31は連続してユーザメモリ空間34へデータアクセスをおこなう。
【0043】
そして、CPU31のアクセスがオペコードまたはオペランドになると、セレクタ51から出力されるメモリ空間信号は1に切り替わる。それによって、立ち上がり検出器53がこのメモリ空間信号の立ち上がりを検出し、ユーザメモリ空間アクセス許可ビット52はクリアされてゼロに戻る。また、メモリ空間はデバッグメモリ空間37に切り替わる。
【0044】
ユーザメモリ空間アクセス許可ビット52がセットされてからクリアされるまでのタイミングチャートを図5に示す。図5においては、“バス”として、具体的なデータではなく、アクセスの種類、すなわちオペコード、オペランドまたはデータを記している。図5に示すタイミングチャートでは、ユーザメモリ空間34へのデータアクセスが、バスのデータ0とデータ1に対して連続しておこなわれている。そして、データ1に対するデータアクセスのつぎのオペコードフェッチによって、メモリ空間信号がゼロから1に切り替わり、ユーザメモリ空間アクセス許可ビット52が1からゼロに戻っている。
【0045】
上述した実施の形態2によれば、ユーザメモリ空間アクセス許可ビット52がセットされている間、CPU31のアクセスがデータアクセスである限り、メモリ空間がユーザメモリ空間34になるので、連続してユーザメモリ空間34へアクセスすることができる。したがって、デバッグ時のユーザメモリ空間34への連続するデータに対するアクセス効率が向上する。
【0046】
以上において本発明は、上述した各実施の形態に限らず、種々変更可能である。たとえば、デバッグメモリ空間とユーザメモリ空間とは、物理的に別々のメモリ内に設けられていてもよいし、物理的に同一のメモリ内に設けられていてもよい。
【0047】
(付記1)デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグ中に前記中央処理装置のアクセスを監視して、ユーザメモリ空間とデバッグメモリ空間とを切り替えるための要因を検出するメモリ空間切り替え要因検出手段を具備することを特徴とするデバッグサポート装置。
【0048】
(付記2)デバッグ中にユーザメモリ空間とデバッグメモリ空間とを切り替える際の切り替えを制御するメモリ空間切り替え制御手段をさらに具備することを特徴とする付記1に記載のデバッグサポート装置。
【0049】
(付記3)前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因として未定義命令フェッチを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする付記2に記載のデバッグサポート装置。
【0050】
(付記4)前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因として、あらかじめ設定されたブレイクポイントを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする付記2に記載のデバッグサポート装置。
【0051】
(付記5)前記メモリ空間切り替え制御手段は、ステップ実行ブレイク許可時に、一命令実行ごとにメモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする付記2に記載のデバッグサポート装置。
【0052】
(付記6)前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因としてリターンインタラプト命令フェッチを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をデバッグメモリ空間からユーザメモリ空間へ切り替える制御をおこなうことを特徴とする付記2〜5のいずれか一つに記載のデバッグサポート装置。
【0053】
(付記7)前記メモリ空間切り替え要因検出手段は、前記メモリ空間切り替え制御手段によりメモリ空間がユーザメモリ空間からデバッグメモリ空間へ切り替えられるときに、中央処理装置に対する強制割り込みを発生することを特徴とする付記2〜5のいずれか一つに記載のデバッグサポート装置。
【0054】
(付記8)デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグメモリ空間からユーザメモリ空間へのアクセスが許可されている間、中央処理装置のアクセスがオペコードフェッチもしくはオペランドフェッチであればメモリ空間がデバッグメモリ空間であることを示す信号を出力し、一方、中央処理装置のアクセスがデータアクセスであればメモリ空間がユーザメモリ空間であることを示す信号を出力するメモリ空間制御手段を具備することを特徴とするデバッグサポート装置。
【0055】
(付記9)デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグメモリ空間からユーザメモリ空間へのアクセスが許可されているときにセットされるアクセス許可ビットと、
メモリ空間がユーザメモリ空間であるときにゼロを出力し、メモリ空間がデバッグメモリ空間であるときに1を出力するメモリ空間制御手段と、
前記アクセス許可ビットがセットされている間、中央処理装置のアクセスがオペコードフェッチもしくはオペランドフェッチであれば1となり、中央処理装置のアクセスがデータアクセスであればゼロとなる信号を選択して出力し、一方、前記アクセス許可ビットがクリアされているときには、前記メモリ空間制御手段から出力される信号を選択して出力するセレクタと、
を具備することを特徴とするデバッグサポート装置。
【0056】
(付記10)前記セレクタの出力信号がゼロから1に切り替わるのを検出したときに、前記アクセス許可ビットをクリアする検出器をさらに具備することを特徴とする付記9に記載のデバッグサポート装置。
【0057】
(付記11)前記セレクタの出力信号がゼロのときにメモリ空間をユーザメモリ空間とし、一方、前記セレクタの出力信号が1のときにメモリ空間をデバッグメモリ空間にするメモリ空間切り替え回路をさらに具備することを特徴とする付記10に記載のデバッグサポート装置。
【0058】
(付記12)前記メモリ空間切り替え要因検出手段は、あらかじめ設定されたブレイク要因と中央処理装置のアクセスとの比較をおこなう比較器、および該比較器での比較結果が一致したときに中央処理装置に対する強制割り込みを発生するブレイク制御手段を具備することを特徴とする付記1に記載のデバッグサポート装置。
【0059】
(付記13)前記比較器は、ブレイク要因の種類に応じて複数設けられていることを特徴とする付記12に記載のデバッグサポート装置。
【0060】
(付記14)前記メモリ空間切り替え制御手段は、前記ブレイク制御手段が中央処理装置に対して強制割り込みを発生したことを検出する強制割り込み検出手段、および該強制割り込み検出手段の検出結果に基づいてメモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなう割り込み処理制御手段を具備することを特徴とする付記12に記載のデバッグサポート装置。
【0061】
(付記15)前記メモリ空間切り替え要因検出手段は、リターンインタラプト命令コードと中央処理装置のフェッチコードとの比較をおこなう比較器を具備することを特徴とする付記1に記載のデバッグサポート装置。
【0062】
(付記16)前記メモリ空間切り替え制御手段は、前記比較器の比較結果に基づいてリターンインタラプト命令フェッチを検出する割り込み復帰検出手段、および該割り込み復帰検出手段の検出結果に基づいてメモリ空間をデバッグメモリ空間からユーザメモリ空間へ切り替える制御をおこなう復帰処理制御手段を具備することを特徴とする付記15に記載のデバッグサポート装置。
【0063】
【発明の効果】
本発明によれば、メモリ空間を切り替える要因を検出する機能と、メモリ空間の切り替えを制御する機能を実装したデバッグサポート装置が得られるという効果を奏する。また、本発明によれば、デバッグ中に、CPUのアクセスがデータアクセスである限り、ユーザメモリ空間への連続するデータアクセスをおこなうことを可能とするデバッグサポート装置が得られるという効果を奏する。
【図面の簡単な説明】
【図1】本発明の実施の形態1にかかるデバッグサポート装置によるデバッグ環境の概略構成を機能的に示すブロック図である。
【図2】本発明の実施の形態1にかかるデバッグサポート装置の詳細な構成を機能的に示すブロック図である。
【図3】本発明の実施の形態2にかかるデバッグサポート装置によるデバッグ環境の概略構成を機能的に示すブロック図である。
【図4】本発明の実施の形態2にかかるデバッグサポート装置のメモリ空間制御部の詳細な構成を機能的に示すブロック図である。
【図5】本発明の実施の形態2にかかるデバッグサポート装置によるメモリ空間の切り替え動作タイミングを示すタイミングチャートである。
【図6】従来のデバッグサポート装置搭載マイクロコンピュータの概略構成を機能的に示すブロック図である。
【符号の説明】
11,31 CPU
12 メモリ空間切り替え要因検出部
13 メモリ空間切り替え制御部
14,34 ユーザメモリ空間
15,35 デバッグサポート装置
16,36 メモリ空間切り替え回路
17,37 デバッグメモリ空間
38 メモリ空間制御部
41 ユーザメモリ空間アクセス制御部
42 メモリ空間制御部本体
51 セレクタ
52 ユーザメモリ空間アクセス許可ビット
53 立ち上がり検出器[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a debug support device mounted on a microcomputer.
[0002]
A microcomputer may be equipped with a debugging support device for debugging a program such as firmware executed by the microcomputer. Such a microcomputer includes a user memory space that stores a program to be debugged and also serves as a work area when the program is executed, and a debug memory space that stores an interrupt processing program for performing debug processing. During debugging, the CPU (central processing unit) accesses both the user memory space and the debug memory space.
[0003]
[Prior art]
FIG. 6 is a block diagram functionally showing a schematic configuration of a conventional microcomputer equipped with a debug support device. As shown in FIG. 6, conventionally, a memory space
[0004]
Therefore, when the
[0005]
On the other hand, when the current memory space is in the debug memory space 7, the
[0006]
Further, in a conventional microcomputer equipped with a debug support device, a one-shot memory space switching signal is generated when accessing the user memory space from the debug memory space. Therefore, it is possible to access the user memory space from the debug memory space only for the next access when the memory space switching signal is generated.
[0007]
Further, a technology for switching a memory space between a debugged system and a debug support system is known for a debug support device (see Patent Document 1). A technique for debugging software arranged on a bank memory using an in-circuit emulator is known (see Patent Document 2).
[0008]
[Patent Document 1]
JP-A-2-28732
[Patent Document 2]
JP-A-5-113906
[0009]
[Problems to be solved by the invention]
However, the CPU of the conventional debug support device-equipped microcomputer (hereinafter referred to as an evaluation microcomputer) has become a microcomputer (hereinafter referred to as a mass production microcomputer) not equipped with a debug support device due to the multi-functionality for switching the memory space. ), The number of gates is increased and the area is increased. Therefore, there is a problem in that the CPU for the evaluation microcomputer and the CPU for the mass production microcomputer are not compatible, so that they must be prepared separately.
[0010]
Further, in the conventional evaluation microcomputer, data access exceeding the data width of the bus from the debug memory space to the user memory space cannot be performed with one instruction. For example, when the CPU reads or writes 16-bit data for an 8-bit bus width, it switches to the first user memory space in one shot, and the first 8-bit data is transferred to the user memory space. Then, the second switch to the user memory space and the remaining 8-bit data are accessed in one shot. Therefore, there is a problem that access efficiency from the debug memory space to the user memory space is poor.
[0011]
The present invention has been made in view of the above problems, and provides a debug support device capable of detecting a memory space switching factor during debugging and controlling switching of a memory space, instead of a CPU. For the purpose. Another object of the present invention is to provide a debugging support device that enables continuous data access to a user memory space during debugging.
[0012]
[Means for Solving the Problems]
In order to achieve the above object, a debugging support apparatus according to the present invention includes a memory space switching factor detecting means for detecting an undefined instruction fetch or a breakpoint, and a memory space as a user memory space when an undefined instruction fetch or a breakpoint is detected. And a memory space switching control means for controlling switching when switching from the debug memory space to the debug memory space. The memory space switching control means switches the memory space from the user memory space to the debug memory space every time one instruction is executed when the step execution break is permitted. When switching the memory space to the debug memory space, the debug support device generates a forced interrupt to the CPU.
[0013]
According to the present invention, the debug support device can detect a memory space switching factor and switch the memory space from the user memory space to the debug memory space instead of the CPU.
[0014]
In the present invention, the memory space switching factor detecting means may detect the RETI instruction fetch, and the memory space switching control means may switch the memory space from the debug memory space to the user memory space at the time of detection. In this case, the debug support device can detect the RETI instruction fetch instead of the CPU and switch the memory space from the debug memory space to the user memory space.
[0015]
In order to achieve the above object, the debug support apparatus according to the present invention has a register that is set when access from the debug memory space to the user memory space is permitted, and this register is set. If the CPU access is a data access, a signal indicating that the memory space is a user memory space is output. If the CPU access is an opcode fetch or operand fetch, the memory space is a debug memory space. It has a memory space control means for outputting a signal. The register is cleared when the signal indicating the memory space is switched from the state indicating the user memory space to the state indicating the debug memory space.
[0016]
According to the present invention, as long as the CPU access is data access during debugging, the memory space becomes the user memory space, so that continuous data access to the user memory space is possible.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0018]
(Embodiment 1)
FIG. 1 is a block diagram functionally showing a schematic configuration of a debug environment by the debug support apparatus according to the first embodiment of the present invention. In FIG. 1, a
[0019]
The memory space switching
[0020]
FIG. 2 is a block diagram functionally showing the detailed configuration of the
[0021]
The memory space switching
[0022]
Here, in FIG. 2, in each of the
[0023]
The
[0024]
The
[0025]
The memory space
[0026]
The interrupt processing / return processing
[0027]
The memory
[0028]
Next, the operation of the apparatus shown in FIG. 2 will be described. When the current memory space is in the
[0029]
When the step execution break is permitted, the memory space switching
[0030]
On the other hand, when the current memory space is in the
[0031]
According to the first embodiment described above, the
[0032]
(Embodiment 2)
FIG. 3 is a block diagram functionally showing a schematic configuration of a debug environment by the debug support apparatus according to the second embodiment of the present invention. In FIG. 3, a
[0033]
The memory
[0034]
When the memory space is in the
[0035]
FIG. 4 is a block diagram functionally showing the detailed configuration of the memory
[0036]
When the value of the user memory space
[0037]
Here, the output signal of the memory space control unit
[0038]
The user memory space
[0039]
The user memory space
[0040]
Next, the operation of the apparatus shown in FIG. 4 will be described. When the current memory space is in the
[0041]
Thereafter, when the access performed by the
[0042]
In this state, when the
[0043]
When the access of the
[0044]
A timing chart from when the user memory space
[0045]
According to the second embodiment described above, while the user memory space
[0046]
In the above, this invention is not restricted to each embodiment mentioned above, A various change is possible. For example, the debug memory space and the user memory space may be provided in physically separate memories, or may be provided in the physically same memory.
[0047]
(Supplementary note 1) A debugging support device mounted on a microcomputer together with a central processing unit capable of accessing both a user memory space and a debugging memory space during debugging,
A debug support apparatus comprising: a memory space switching factor detection unit that monitors accesses of the central processing unit during debugging and detects factors for switching between a user memory space and a debug memory space.
[0048]
(Supplementary note 2) The debug support device according to
[0049]
(Supplementary Note 3) When the memory space switching factor detecting unit detects an undefined instruction fetch as a factor for switching the memory space, the memory space switching control unit controls the memory space to switch from the user memory space to the debug memory space. The debug support device according to
[0050]
(Supplementary Note 4) When the memory space switching factor detecting means detects a break point set in advance as a factor for switching the memory space, the memory space switching control means changes the memory space from the user memory space to the debug memory space. The debug support device according to
[0051]
(Supplementary note 5) The debug support according to
[0052]
(Supplementary Note 6) When the memory space switching factor detecting unit detects a return interrupt instruction fetch as a factor for switching the memory space, the memory space switching control unit controls the switching of the memory space from the debug memory space to the user memory space. The debug support device according to any one of
[0053]
(Supplementary note 7) The memory space switching factor detecting means generates a forced interrupt to the central processing unit when the memory space is switched from the user memory space to the debug memory space by the memory space switching control means. The debug support device according to any one of
[0054]
(Supplementary note 8) A debugging support device mounted on a microcomputer together with a central processing unit capable of accessing both a user memory space and a debugging memory space during debugging,
While access from the debug memory space to the user memory space is permitted, a signal indicating that the memory space is the debug memory space is output if the central processing unit access is an opcode fetch or operand fetch, A debugging support device comprising memory space control means for outputting a signal indicating that the memory space is a user memory space if the access of the processing device is data access.
[0055]
(Supplementary note 9) A debugging support device mounted on a microcomputer together with a central processing unit capable of accessing both a user memory space and a debugging memory space during debugging,
An access permission bit that is set when access from the debug memory space to the user memory space is permitted;
Memory space control means for outputting zero when the memory space is a user memory space and outputting 1 when the memory space is a debug memory space;
While the access permission bit is set, select and output a signal that becomes 1 if the access of the central processing unit is an opcode fetch or operand fetch, and becomes zero if the access of the central processing unit is a data access, On the other hand, when the access permission bit is cleared, a selector that selects and outputs a signal output from the memory space control means;
A debug support apparatus comprising:
[0056]
(Supplementary note 10) The debug support device according to supplementary note 9, further comprising a detector that clears the access permission bit when it is detected that the output signal of the selector is switched from zero to one.
[0057]
(Supplementary Note 11) A memory space switching circuit is further provided that sets the memory space as a user memory space when the output signal of the selector is zero, and sets the memory space as a debug memory space when the output signal of the selector is 1. The debug support apparatus according to Supplementary Note 10, wherein
[0058]
(Supplementary Note 12) The memory space switching factor detection means is configured to compare a break factor set in advance with the access of the central processing unit, and to the central processing unit when the comparison result in the comparator matches. The debug support device according to
[0059]
(Supplementary note 13) The debug support device according to
[0060]
(Supplementary Note 14) The memory space switching control means includes a forced interrupt detection means for detecting that the break control means has generated a forced interrupt to the central processing unit, and a memory based on a detection result of the forced interrupt detection means. The debug support apparatus according to
[0061]
(Supplementary note 15) The debug support device according to
[0062]
(Supplementary Note 16) The memory space switching control means detects an interrupt return detection means for detecting a return interrupt instruction fetch based on the comparison result of the comparator, and sets the memory space as a debug memory based on the detection result of the interrupt return detection means. The debugging support device according to
[0063]
【The invention's effect】
According to the present invention, it is possible to obtain a debug support device in which a function for detecting a factor for switching a memory space and a function for controlling switching of a memory space are provided. In addition, according to the present invention, it is possible to obtain a debug support device that enables continuous data access to the user memory space as long as the CPU access is data access during debugging.
[Brief description of the drawings]
FIG. 1 is a block diagram functionally showing a schematic configuration of a debug environment by a debug support apparatus according to a first embodiment of the present invention;
FIG. 2 is a block diagram functionally showing a detailed configuration of the debug support apparatus according to the first exemplary embodiment of the present invention;
FIG. 3 is a block diagram functionally showing a schematic configuration of a debug environment by the debug support apparatus according to the second embodiment of the present invention;
FIG. 4 is a block diagram functionally illustrating a detailed configuration of a memory space control unit of the debug support device according to the second exemplary embodiment of the present invention;
FIG. 5 is a timing chart showing a memory space switching operation timing by the debug support device according to the second exemplary embodiment of the present invention;
FIG. 6 is a block diagram functionally showing a schematic configuration of a conventional microcomputer equipped with a debug support device.
[Explanation of symbols]
11,31 CPU
12 Memory space switching factor detector
13 Memory space switching control unit
14,34 User memory space
15, 35 Debug support device
16, 36 Memory space switching circuit
17, 37 Debug memory space
38 Memory space controller
41 User memory space access controller
42 Memory space control unit body
51 selector
52 User memory space access permission bit
53 Rising detector
Claims (1)
前記中央処理装置の前記ユーザメモリ空間へのアクセスが許可されているときにセットされるアクセス許可ビットと、
リターンインタラプト命令フェッチを検出した場合には、前記ユーザメモリ空間に切り替えるためのゼロを出力し、強制割り込みの発生を検出した場合には、前記デバックメモリ空間に切り替えるための1を出力するメモリ空間制御手段と、
前記アクセス許可ビットがセットされている間、前記中央処理装置のアクセスがオペコードフェッチもしくはオペランドフェッチであれば1となり、前記中央処理装置のアクセスがデータアクセスであればゼロとなる信号を選択して出力し、一方、前記アクセス許可ビットがクリアされているときには、前記メモリ空間制御手段から出力される信号を選択して出力するセレクタと、
前記セレクタの出力信号がゼロから1に切り替わるのを検出したときに、前記アクセス許可ビットをクリアする検出器と、
を具備することを特徴とするデバッグサポート装置。A debugging support device mounted on a microcomputer together with a central processing unit capable of accessing both the user memory space and the debugging memory space during debugging,
And permissions bit is set when the access to the user memory space of the central processing unit is permitted,
Memory space control that outputs zero for switching to the user memory space when a return interrupt instruction fetch is detected, and outputs 1 for switching to the debug memory space when occurrence of a forced interrupt is detected Means,
Said access while the enable bit is set, becomes 1 if the access code fetch or operand fetch of the central processing unit, the access CPU selects the signal which becomes zero when the data access output On the other hand, when the access permission bit is cleared, a selector that selects and outputs a signal output from the memory space control means;
A detector that clears the access permission bit when it detects that the output signal of the selector switches from zero to one;
A debug support apparatus comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003040212A JP4044455B2 (en) | 2003-02-18 | 2003-02-18 | Debug support device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003040212A JP4044455B2 (en) | 2003-02-18 | 2003-02-18 | Debug support device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004252589A JP2004252589A (en) | 2004-09-09 |
JP4044455B2 true JP4044455B2 (en) | 2008-02-06 |
Family
ID=33024163
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003040212A Expired - Lifetime JP4044455B2 (en) | 2003-02-18 | 2003-02-18 | Debug support device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4044455B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100375060C (en) * | 2005-06-20 | 2008-03-12 | 中兴通讯股份有限公司 | Embedded system and real-time monitoring and processing method thereof |
-
2003
- 2003-02-18 JP JP2003040212A patent/JP4044455B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JP2004252589A (en) | 2004-09-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6915416B2 (en) | Apparatus and method for microcontroller debugging | |
JP5668143B2 (en) | Debugging data processing equipment | |
US7334161B2 (en) | Breakpoint logic unit, debug logic and breakpoint method for a data processing apparatus | |
US7752427B2 (en) | Stack underflow debug with sticky base | |
EP0702297B1 (en) | A data processor with breakpoint circuit | |
JP2003296136A (en) | Trace device | |
US20110179255A1 (en) | Data processing reset operations | |
EP0530816A2 (en) | Microprocessor with cache memory and trace analyzer therefor | |
JP4044455B2 (en) | Debug support device | |
JP3590282B2 (en) | Stop point interrupt generator for superscalar microprocessor | |
US6550015B1 (en) | Scalable virtual timer architecture for efficiently implementing multiple hardware timers with minimal silicon overhead | |
KR102603835B1 (en) | Method and apparatus for protecting the program counter structure of a processor system and monitoring processing of interrupt requests | |
US20080133838A1 (en) | Data processing device | |
JP5387521B2 (en) | Logic verification scenario generation device and logic verification scenario generation program | |
JP2003281076A (en) | Unauthorized access detection circuit of dma controller, unauthorized access detecting method and program thereof | |
JPS62197831A (en) | Data processor | |
JP2734382B2 (en) | In-circuit emulator and debugging method thereof | |
KR101244684B1 (en) | Microcomputing apparatus and method capable of detecting error | |
JP2002163126A (en) | Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit | |
JPH04264923A (en) | Information processor | |
JPH08263324A (en) | Debug facilitation device | |
JP2002351696A (en) | Debugging device | |
JP2004185060A (en) | Microcomputer | |
JPH0816434A (en) | Runaway detection device | |
JP2687750B2 (en) | Electronic computer processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040625 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070111 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070123 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070326 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070605 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070806 |
|
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: 20071106 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20071115 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4044455 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101122 Year of fee payment: 3 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101122 Year of fee payment: 3 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101122 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111122 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111122 Year of fee payment: 4 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111122 Year of fee payment: 4 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111122 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121122 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121122 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131122 Year of fee payment: 6 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
EXPY | Cancellation because of completion of term |