JP2004252589A - Debugging support device - Google Patents

Debugging support device Download PDF

Info

Publication number
JP2004252589A
JP2004252589A JP2003040212A JP2003040212A JP2004252589A JP 2004252589 A JP2004252589 A JP 2004252589A JP 2003040212 A JP2003040212 A JP 2003040212A JP 2003040212 A JP2003040212 A JP 2003040212A JP 2004252589 A JP2004252589 A JP 2004252589A
Authority
JP
Japan
Prior art keywords
memory space
debug
debugging
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.)
Granted
Application number
JP2003040212A
Other languages
Japanese (ja)
Other versions
JP4044455B2 (en
Inventor
Takashi Sato
崇 佐藤
Toshiyuki Igarashi
稔行 五十嵐
Nobuhiko Akasaka
伸彦 赤坂
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003040212A priority Critical patent/JP4044455B2/en
Publication of JP2004252589A publication Critical patent/JP2004252589A/en
Application granted granted Critical
Publication of JP4044455B2 publication Critical patent/JP4044455B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a debugging support device which performs detection of a memory space switching factor in debugging and switching control of a memory space instead of a central processing unit. <P>SOLUTION: This debugging support device 16 comprises a memory space switching factor detection part 12 for detecting an undefined instruction fetch or break point, and a memory space switching control part 13 for controlling the switching of the memory space from a user memory space 14 to a debugging memory space 17 in the detection of the undefined instruction fetch or break point. The memory space switching control part 13 switches the memory space from the user memory space 14 to the debugging memory space 17 for every instruction execution when a step execution break is permitted. When the memory space is switched to the debugging memory space 17, the memory space switching factor detection part 12 generates a forced interruption to a CPU 11. <P>COPYRIGHT: (C)2004,JPO&NCIPI

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 switching factor detector 2 that realizes a function of detecting a switching factor between the user memory space 4 and the debug memory space 7 and a function of controlling switching of the memory space are realized. The memory space switching control unit 3 is provided in the CPU 1.
[0004]
Therefore, when the CPU 1 performs break point detection, undefined instruction fetch detection, or step execution break when the current memory space is in the user memory space 4, the CPU 1 starts forced interrupt processing. As a result, the memory space is switched to the debug memory space 7 via the memory space switching circuit 6 of the debug support device 5.
[0005]
On the other hand, when the current memory space is in the debug memory space 7, the CPU 1 switches the memory space to the user memory space 4 when detecting a RETI instruction (return interrupt instruction) fetch. At the same time, the CPU 1 executes a RETI instruction and performs a return for a forced interrupt when shifting from the user memory space 4 to the debug memory space 7.
[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 increases and the area increases. 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 debugging 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 CPU 11, a memory space switching factor detection unit 12, a memory space switching control unit 13, a user memory space 14, a debug support device 15, a memory space switching circuit 16, and a debug memory space 17 are constituent elements of an evaluation microcomputer. is there.
[0019]
The memory space switching factor detection unit 12 and the memory space switching control unit 13 are mounted on the debug support device 15. Therefore, in the first embodiment, the CPU 11 does not have a function of detecting a memory space switching factor and a function of controlling switching of the memory space. These functions are realized by the debug support device 15.
[0020]
FIG. 2 is a block diagram functionally showing the detailed configuration of the debug support apparatus 15. As shown in FIG. 2, the memory space switching factor detector 12 includes a break controller 21 and a plurality of comparators 22a, 22b, 22c, and 22d. Although four comparators are shown in FIG. 2, the number of comparators is increased or decreased according to the number of break factors such as an address break, an instruction break, an operand break, or a data break. Five or more may be sufficient. In the following description, for the sake of convenience, the first comparator 22a, the second comparator 22b, the third comparator 22c, and the fourth comparator 22d are used.
[0021]
The memory space switching factor detection unit 12 constantly monitors accesses performed by the CPU 11 to the user memory space 14 or the debug memory space 17 via the memory space switching circuit 16. Then, the first comparator 22a, the second comparator 22b, the third comparator 22c, and the fourth comparator 22d are assigned to various breakpoint codes and RETI instruction codes, respectively. The code is compared with the code fetched by the CPU 11.
[0022]
Here, in FIG. 2, in each of the comparators 22a, 22b, 22c, and 22d, the comparison target for the fetch code of the CPU 11 is clearly shown, and the codes of various break points are assigned to the corresponding first to third comparators 22a. , 22b, 22c, and shown as break factor 0, break factor 1 and break factor n. Further, the code of the RETI instruction is also extracted from the corresponding fourth comparator 22d and clearly shown.
[0023]
The break control unit 21 forces the CPU 11 when any of the first to third comparators 22a, 22b, and 22c matches the CPU 11 fetch code and the break point code, that is, when a break point is detected. Interrupt. In addition, when the step execution break is permitted, the break control unit 21 issues a forced interrupt to the CPU 11 every time one instruction is executed in the user memory space 14.
[0024]
The break control unit 21 also issues a forced interrupt to the CPU 11 when the CPU 11 fetches an undefined instruction. Although the undefined instruction fetch is detected by the memory space switching factor detector 12, the configuration for realizing this detection function is not shown.
[0025]
The memory space switching control unit 13 includes a forced interrupt / interrupt return detection unit 25 and an interrupt processing / return processing sequence control unit 26. The forced interrupt / interrupt return detection unit 25 detects that the CPU 11 has been forcedly interrupted by the break control unit 21. The forced interrupt / interrupt return detection unit 25 detects in the fourth comparator 22d that the fetch code of the CPU 11 matches the code of the RETI instruction.
[0026]
The interrupt processing / return processing sequence control unit 26 switches sequence control for switching the memory space from the user memory space 14 to the debug memory space 17 when the forced interrupt / interrupt return detection unit 25 detects the occurrence of a forced interrupt to the CPU 11. To do. The interrupt processing / return processing sequence control unit 26 performs sequence control for switching the memory space from the debug memory space 17 to the user memory space 14 when the RETI instruction is detected by the forced interrupt / interrupt return detection unit 25. .
[0027]
The memory space switching circuit 16 switches the memory space based on the sequence control of the interrupt processing / return processing sequence control unit 26. When a forced interrupt occurs, the CPU 11 performs an interrupt process. In addition, the CPU 11 executes a RETI instruction and performs a return process for a forced interrupt.
[0028]
Next, the operation of the apparatus shown in FIG. 2 will be described. When the current memory space is in the user memory space 14, when the CPU 11 detects that the CPU 11 has performed an undefined instruction fetch or breakpoint access, the memory space switching factor detector 12 generates a forced interrupt to the CPU 11. To do. Thereby, the CPU 11 starts an interrupt process. Further, when the occurrence of a forced interrupt to the CPU 11 is notified, the memory space switching control unit 13 outputs a signal for switching the memory space to the debug memory space 17 to the memory space switching circuit 16. Thereby, the memory space is switched to the debug memory space 17.
[0029]
When the step execution break is permitted, the memory space switching factor detection unit 12 generates a forced interrupt to the CPU 11 every time one instruction is executed in the user memory space 14. Thereby, the CPU 11 performs an interrupt process for every execution of an instruction. Further, the memory space switching control unit 13 outputs a signal for switching the memory space to the debug memory space 17 to the memory space switching circuit 16 every time one instruction is executed. As a result, the memory space is switched to the debug memory space 17 for each instruction.
[0030]
On the other hand, when the current memory space is in the debug memory space 17, when detecting that the CPU 11 has performed the RETI instruction fetch, the memory space switching factor detection unit 12 notifies the memory space switching control unit 13 of the fact. Based on the notification, the memory space switching control unit 13 outputs a signal for switching the memory space to the user memory space 14 to the memory space switching circuit 16. As a result, the memory space is switched to the user memory space 14. At the same time, the CPU 11 executes a RETI instruction and performs a return process for a forced interrupt when shifting from the user memory space 14 to the debug memory space 17.
[0031]
According to the first embodiment described above, the debug support device 15 is provided with the function of detecting the cause of switching the memory space and the function of controlling the switching of the memory space. 15 can switch the memory space. Therefore, since the evaluation microcomputer can be configured without increasing the number of functions, gates and size of the CPU 11, the CPU 11 for the evaluation microcomputer and the CPU for the mass production microcomputer can be compatible. it can. For example, in the case of an 8-bit CPU, although depending on the number of break factors to be defined, the gate area of the CPU can be improved by about 10 to 20% compared to the conventional case.
[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 CPU 31, a user memory space 34, a debug support device 35, a memory space switching circuit 36, a debug memory space 37, a memory space control unit 38, a user memory space access control unit 41, and a memory space control unit main body 42 are evaluated. It is a component of the microcomputer.
[0033]
The memory space control unit 38 is mounted on the debug support device 35. The user memory space access control unit 41 and the memory space control unit main body 42 are mounted on the memory space control unit 38. The user memory space access control unit 41 realizes a function of performing continuous data access to the user memory space 34 during debugging.
[0034]
When the memory space is in the user memory space 34, the memory space control unit main body 42 switches the memory space to the debug memory space 37 after detecting the debug memory space switching factor. When the memory space is in the debug memory space 37, the memory space control unit main body 42 switches the memory space to the user memory space 34 after detecting the user memory space switching factor.
[0035]
FIG. 4 is a block diagram functionally showing the detailed configuration of the memory space control unit 38 of the debug support apparatus. As shown in FIG. 4, the user memory space access control unit 41 includes a selector 51, a user memory space access permission bit 52, and a rising detector 53.
[0036]
When the value of the user memory space access permission bit 52 is zero, the selector 51 supplies the output signal of the memory space control unit main body 42 as a signal indicating the memory space (memory space signal) to the memory space switching circuit 36. Further, when the value of the user memory space access permission bit 52 is 1, the selector 51 supplies an operation code signal or an operand signal as a memory space signal to the memory space switching circuit 36.
[0037]
Here, the output signal of the memory space control unit main body 42 indicates the user memory space 34 when it is zero, and indicates the debug memory space 37 when it is 1. The opcode signal or operand signal becomes 1 when the access of the CPU 31 is an opcode fetch or operand fetch, and becomes zero when the access of the CPU 31 is a data access. The memory space when the access of the CPU 31 is an opcode fetch or an operand fetch is a debug memory space 37. A memory space when the CPU 31 accesses data is a user memory space 34.
[0038]
The user memory space access permission bit 52 is a bit for permitting access from the debug memory space 37 to the user memory space 34, and is set by the CPU 31. When the user memory space access permission bit 52 is set, that is, when the value of the user memory space access permission bit 52 is 1, the next data access to the user memory space 34 is permitted. The user memory space access permission bit 52 is provided in a register in the debug support device 35 and constitutes a part of the debug memory space 37, but this is omitted in FIG.
[0039]
The user memory space access permission bit 52 is cleared and returned to zero when the memory space signal output from the selector 51 changes from zero to one. The rising detector 53 detects that the memory space signal output from the selector 51 has changed from zero to one.
[0040]
Next, the operation of the apparatus shown in FIG. 4 will be described. When the current memory space is in the debug memory space 37, if the user memory space access permission bit 52 is set, the memory space signal output from the selector 51 is obtained from the output signal of the memory space control unit main body 42 from the opcode signal or Switch to operand signal.
[0041]
Thereafter, when the access performed by the CPU 31 is data, the memory space becomes the user memory space 34, and the memory space signal output from the selector 51 is zero. Therefore, since the rise detector 53 does not detect the rise of the memory space signal, the user memory space access permission bit 52 is not cleared and remains set.
[0042]
In this state, when the CPU 31 subsequently performs data access, the memory space becomes the user memory space 34. Thus, until the CPU 31 next accesses the opcode or operand, the memory space becomes the user memory space 34, and the CPU 31 continuously accesses the user memory space 34.
[0043]
When the access of the CPU 31 becomes an opcode or an operand, the memory space signal output from the selector 51 is switched to 1. As a result, the rise detector 53 detects the rise of this memory space signal, and the user memory space access permission bit 52 is cleared and returns to zero. The memory space is switched to the debug memory space 37.
[0044]
A timing chart from when the user memory space access permission bit 52 is set to when it is cleared is shown in FIG. In FIG. 5, “bus” indicates not the specific data but the type of access, that is, the operation code, operand or data. In the timing chart shown in FIG. 5, data access to the user memory space 34 is continuously performed for data 0 and data 1 on the bus. Then, the memory space signal is switched from zero to 1 by the next opcode fetch of data access to data 1, and the user memory space access permission bit 52 is returned from 1 to zero.
[0045]
According to the second embodiment described above, while the user memory space access permission bit 52 is set, the memory space becomes the user memory space 34 as long as the access of the CPU 31 is data access. The space 34 can be accessed. Therefore, the access efficiency for continuous data to the user memory space 34 at the time of debugging is improved.
[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 debugging support device comprising: a memory space switching factor detecting means for detecting a factor for switching between a user memory space and a debugging memory space by monitoring access of the central processing unit during debugging.
[0048]
(Supplementary note 2) The debug support device according to supplementary note 1, further comprising memory space switching control means for controlling switching when switching between the user memory space and the debug memory space during debugging.
[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 appendix 2, characterized in that:
[0050]
(Supplementary Note 4) When the memory space switching factor detecting means detects a breakpoint 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 appendix 2, wherein control to switch to is performed.
[0051]
(Supplementary note 5) The debug support according to supplementary note 2, wherein the memory space switching control means performs control to switch the memory space from the user memory space to the debug memory space for each instruction execution when step execution break is permitted. apparatus.
[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 appendices 2 to 5, wherein:
[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 appendices 2 to 5.
[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 debugging support device 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 appendix 1, further comprising break control means for generating a forced interrupt.
[0059]
(Supplementary note 13) The debug support device according to supplementary note 12, wherein a plurality of the comparators are provided according to the type of break factor.
[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. 13. The debug support apparatus according to appendix 12, further comprising an interrupt processing control unit that performs control for switching the space from the user memory space to the debug memory space.
[0061]
(Supplementary note 15) The debug support device according to supplementary note 1, wherein the memory space switching factor detection means includes a comparator for comparing the return interrupt instruction code with the fetch code of the central processing unit.
[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. 16. The debug support device according to appendix 15, further comprising return processing control means for performing control for switching from space to user memory space.
[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, as long as the CPU access is data access during debugging, it is possible to obtain a debug support device that enables continuous data access to the user memory space.
[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 (10)

デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグ中に前記中央処理装置のアクセスを監視して、ユーザメモリ空間とデバッグメモリ空間とを切り替えるための要因を検出するメモリ空間切り替え要因検出手段を具備することを特徴とするデバッグサポート装置。
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 debugging support device comprising: a memory space switching factor detecting means for detecting a factor for switching between a user memory space and a debugging memory space by monitoring access of the central processing unit during debugging.
デバッグ中にユーザメモリ空間とデバッグメモリ空間とを切り替える際の切り替えを制御するメモリ空間切り替え制御手段をさらに具備することを特徴とする請求項1に記載のデバッグサポート装置。2. The debugging support apparatus according to claim 1, further comprising a memory space switching control unit that controls switching when switching between the user memory space and the debugging memory space during debugging. 前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因として未定義命令フェッチを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする請求項2に記載のデバッグサポート装置。When the memory space switching factor detection means detects an undefined instruction fetch as a factor for switching the memory space, the memory space switching control means performs control to switch the memory space from the user memory space to the debug memory space. The debugging support device according to claim 2, wherein 前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因として、あらかじめ設定されたブレイクポイントを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする請求項2に記載のデバッグサポート装置。When the memory space switching factor detecting unit detects a breakpoint set in advance as a factor for switching the memory space, the memory space switching control unit performs control to switch the memory space from the user memory space to the debug memory space. The debugging support apparatus according to claim 2, wherein the debugging support apparatus performs the debugging. 前記メモリ空間切り替え制御手段は、ステップ実行ブレイク許可時に、一命令実行ごとにメモリ空間をユーザメモリ空間からデバッグメモリ空間へ切り替える制御をおこなうことを特徴とする請求項2に記載のデバッグサポート装置。3. The debug support apparatus according to claim 2, wherein the memory space switching control unit performs control to switch the memory space from the user memory space to the debug memory space for each instruction execution when step execution break is permitted. 前記メモリ空間切り替え要因検出手段が、メモリ空間を切り替えるための要因としてリターンインタラプト命令フェッチを検出すると、前記メモリ空間切り替え制御手段は、メモリ空間をデバッグメモリ空間からユーザメモリ空間へ切り替える制御をおこなうことを特徴とする請求項2〜5のいずれか一つに記載のデバッグサポート装置。When the memory space switching factor detection means detects a return interrupt instruction fetch as a factor for switching the memory space, the memory space switching control means performs control to switch the memory space from the debug memory space to the user memory space. The debug support device according to any one of claims 2 to 5, wherein 前記メモリ空間切り替え要因検出手段は、前記メモリ空間切り替え制御手段によりメモリ空間がユーザメモリ空間からデバッグメモリ空間へ切り替えられるときに、中央処理装置に対する強制割り込みを発生することを特徴とする請求項2〜5のいずれか一つに記載のデバッグサポート装置。3. The memory space switching factor detection means generates a forced interrupt to the central processing unit when the memory space is switched from a user memory space to a debug memory space by the memory space switching control means. The debug support device according to any one of 5 above. デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグメモリ空間からユーザメモリ空間へのアクセスが許可されている間、中央処理装置のアクセスがオペコードフェッチもしくはオペランドフェッチであればメモリ空間がデバッグメモリ空間であることを示す信号を出力し、一方、中央処理装置のアクセスがデータアクセスであればメモリ空間がユーザメモリ空間であることを示す信号を出力するメモリ空間制御手段を具備することを特徴とするデバッグサポート装置。
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.
デバッグ中にユーザメモリ空間とデバッグメモリ空間の両方にアクセス可能な中央処理装置とともにマイクロコンピュータに搭載されるデバッグサポート装置であって、
デバッグメモリ空間からユーザメモリ空間へのアクセスが許可されているときにセットされるアクセス許可ビットと、
メモリ空間がユーザメモリ空間であるときにゼロを出力し、メモリ空間がデバッグメモリ空間であるときに1を出力するメモリ空間制御手段と、
前記アクセス許可ビットがセットされている間、中央処理装置のアクセスがオペコードフェッチもしくはオペランドフェッチであれば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,
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 debugging support device comprising:
前記セレクタの出力信号がゼロから1に切り替わるのを検出したときに、前記アクセス許可ビットをクリアする検出器をさらに具備することを特徴とする請求項9に記載のデバッグサポート装置。The debug support device according to claim 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.
JP2003040212A 2003-02-18 2003-02-18 Debug support device Expired - Lifetime JP4044455B2 (en)

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 true JP2004252589A (en) 2004-09-09
JP4044455B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
JP4044455B2 (en) 2008-02-06

Similar Documents

Publication Publication Date Title
US6915416B2 (en) Apparatus and method for microcontroller debugging
JP2005317023A (en) Breakpoint logic unit, debug logic, and breakpoint method for data processing apparatus
US7752427B2 (en) Stack underflow debug with sticky base
EP0702297B1 (en) A data processor with breakpoint circuit
US20030192034A1 (en) Trace device preventing loss of trace information which will be important in debugging
JP2002342114A (en) Processor capable of collecting trace data
EP0530816A2 (en) Microprocessor with cache memory and trace analyzer therefor
JP4044455B2 (en) Debug support device
JP3590282B2 (en) Stop point interrupt generator for superscalar microprocessor
KR102603835B1 (en) Method and apparatus for protecting the program counter structure of a processor system and monitoring processing of interrupt requests
JP2011154459A (en) Program abnormal operation detection device for computer system
US20080133838A1 (en) Data processing device
JP2003281076A (en) Unauthorized access detection circuit of dma controller, unauthorized access detecting method and program thereof
JP2734382B2 (en) In-circuit emulator and debugging method thereof
JPH04264923A (en) Information processor
JP2007026091A (en) Interrupt control circuit and its control method
JP2002163126A (en) Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit
JP2006099654A (en) Semiconductor circuit apparatus
JP4426344B2 (en) Memory device control method and apparatus
JP2002351696A (en) Debugging device
JPH08263324A (en) Debug facilitation device
JP2006079180A (en) Microcomputer
JP2687750B2 (en) Electronic computer processor
JPH11167500A (en) Event circuit and debug system for emulator device
JP2004185356A (en) Debug system

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