JP3698478B2 - Debug device - Google Patents

Debug device Download PDF

Info

Publication number
JP3698478B2
JP3698478B2 JP04489396A JP4489396A JP3698478B2 JP 3698478 B2 JP3698478 B2 JP 3698478B2 JP 04489396 A JP04489396 A JP 04489396A JP 4489396 A JP4489396 A JP 4489396A JP 3698478 B2 JP3698478 B2 JP 3698478B2
Authority
JP
Japan
Prior art keywords
register
instruction
signal
program
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP04489396A
Other languages
Japanese (ja)
Other versions
JPH09237200A (en
Inventor
英裕 高田
竹虎 白石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP04489396A priority Critical patent/JP3698478B2/en
Publication of JPH09237200A publication Critical patent/JPH09237200A/en
Application granted granted Critical
Publication of JP3698478B2 publication Critical patent/JP3698478B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Tests Of Electronic Circuits (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明はデバッグ装置、即ちハードウェア上でプログラムがプログラマの意図通りに動作するか否かを検証する(デバッグする)ためのデバッグ装置に関し、特にJTAGに準拠したデバッグ装置に関する。
【0002】
【従来の技術】
従来のデバッグ装置の一例としてJTAG(Joint Test Action Group) がIEEE標準1149.1として定めているテストアーキテクチャ及びテストインタフェイスに準拠したテストアクセスポート(Test Access Port:TAP)コントローラを用いたデバッグ装置が知られている。なお、「JTAG」とは本来はテスト容易化設計手法の標準化のための組織のことであるが、今日ではこの組織が標準化したテストインタフェイスの仕様もJTAGと通称されている。
【0003】
そのような技術を利用したデバッグ装置の一例としてモトローラ社製の DSP161Xシリーズの LSIチップに内蔵されているテスト&デバッグ装置の構成を図14のブロック図に示す。
【0004】
図14において、参照符号1はJTAGがIEEE標準1149.1として定めているテストアーキテクチャ及びテストインタフェイスに準拠したテストアクセスポート(Test Access Port:TAP)コントローラ(以下、 TAPコントローラと言う)を示している。この TAPコントローラ1は、外部から入力端子54に与えられる TCK(Test ClocK)信号, 入力端子55に与えられる TMS(Test Mode Select)信号及び入力端子53に与えられるTRST(Test ReSeT)信号に従って、所定の状態遷移を行なう(詳細は図2参照)。この TAPコントローラ1の状態遷移と後述する命令デコーダ3による命令コードのデコード結果の信号とに従って生成される制御信号は後述する命令レジスタ2, フラグレジスタ5,転送レジスタ6,コントロールレジスタ16, マルチプレクサ8に与えられている。
【0005】
命令レジスタ2は外部からのNビットのシリアル入力であるTDI(Test Data Input)信号の入力端子51とNビットの外部へのシリアル出力である TDO(Test Data Output)信号の出力端子52との間に構成されるJTAGにより定められているプロトコルによりアクセス可能なNビットのスキャンパス上に位置している。なお、以下の説明では、JTAGにより定められているプロトコルによりアクセスすることをJTAGアクセスと言う。そして、命令レジスタ2は外部から TDI信号として入力されたテスト命令をこのスキャンパスを経由して格納する。なお、 TDI信号の入力端子51と TDO信号の入力端子52との間に構成されるスキャンパス上にはこの命令レジスタ2の他にフラグレジスタ5, 転送レジスタ6及びコントロールレジスタ16が位置している。
【0006】
命令デコーダ3は、命令レジスタ2の内容、即ち命令レジスタ2に格納されている命令コードをデコードし、その結果得られた信号を TAPコントローラ1に与える。この命令デコーダ3がデコードする命令は、IEEE標準の1149.1(1990)で定義されている3種類の必須命令の他にテスト及びデバッグに必要なプライベート命令をもサポートしている。
【0007】
フラグレジスタ5は、上述のJTAGアクセス可能なNビットのスキャンパスを通じてアクセス可能であり、チップ内部の状態を記憶する。このフラグレジスタ5は複数ビット幅であり、たとえば JINT(JTAG割り込み), PINT(JTAG割り込みステイタス) 等の割り込みフラグ, 演算結果のキャリー, オーバフロー等のフラグを含む。
【0008】
転送レジスタ6は、前述のJTAGアクセス可能なNビットのスキャンパスを通じてアクセス可能であり、外部からJTAGアクセスを行なうことにより、内部のレジスタ,メモリへのアクセスが可能である。具体的には、転送レジスタ6は後述するプログラムメモリ9, 内部レジスタ10及び内部メモリ11と相互にデータの転送が可能であり、その制御は後述するコントロールレジスタ16により司られる。
【0009】
マルチプレクサ8は、Nビットのスキャンパス出力の内の一つ、即ち命令レジスタ2,フラグレジスタ5,転送レジスタ6,コントロールレジスタ16の出力の内の一つを TAPコントローラ1の制御により選択し、 TDO信号としてシリアル出力する。
【0010】
プログラムメモリ9は、前述の如く転送レジスタ6との間でデータの転送が可能であり、このチップが実行すべきプログラムを格納する。
【0011】
内部レジスタ10はチップ内に通常備えられている一つまたは複数個のレジスタであり、前述の如く転送レジスタ6との間でデータの転送が可能である。内部メモリ11はチップ内に通常備えられている一つまたは複数個のメモリであり、前述の如く転送レジスタ6との間でデータの転送が可能である。
【0012】
コントロールレジスタ16は、プログラムメモリ9, 内部レジスタ10, 内部メモリ11の内のいずれかと転送レジスタ6との接続を制御する。このコントロールレジスタ16の制御により、転送レジスタ6からプログラムメモリ9, 内部レジスタ10または内部メモリ11へデータが転送され、またプログラムメモリ9, 内部レジスタ10または内部メモリ11からデータが転送レジスタ6へ転送される。
【0013】
参照符号17は割り込み制御部を示している。この割り込み制御部17は、上述のコントロールレジスタ16による転送レジスタ6とプログラムメモリ9, 内部レジスタ10, 内部メモリ11との間の転送の際の同期をとるための割り込み制御を司る。具体的には、割り込み制御部17はフラグレジスタ5から与えられるJINT信号に基づいてチップの動作を停止し、転送レジスタ6の内容をプログラムメモリ9, 内部レジスタ10, 内部メモリ11のいずれかへ転送し、また逆にプログラムメモリ9, 内部レジスタ10, 内部メモリ11のいずれかの内容を転送レジスタ6へ転送し、その後にPINT信号をセットする。
【0014】
以上のような従来のデバッグ装置の動作は以下の如くである。まず、チップ外部から内部へのデータの書き込みの際の動作について説明する。
【0015】
命令レジスタ2に書き込み命令の設定を、コントロールレジスタ16に書き込み先がプログラムメモリ9,内部レジスタ10, 内部メモリ11のいずれであるかの設定をそれぞれチップ外部からJTAGアクセスにより行なう。書き込むべきデータを転送レジスタ6にチップ外部からJTAGアクセスにより設定し、設定終了後にフラグレジスタ5のJINTフラグの設定をチップ外部からJTAGアクセスにより行なう。JINTフラグが設定されたことにより、割り込み制御部17はチップの動作を停止させ、転送レジスタ6の内容をコントロールレジスタ16に設定されている転送先、即ちプログラムメモリ9, 内部レジスタ10, 内部メモリ11のいずれかへ転送する。以上により、書き込み動作が完了する。
【0016】
次に、チップ内部から外部へのデータの読み出しの際の動作について説明する。
【0017】
命令レジスタ2に読み出し命令の設定を、コントロールレジスタ16に読み出し元がプログラムメモリ9, 内部レジスタ10, 内部メモリ11のいずれであるかの設定をそれぞれチップ外部からJTAGアクセスを用いて行なう。フラグレジスタ5のJINTフラグの設定をチップ外部からJTAGアクセスにより行なう。JINTフラグが設定されたことにより、割り込み制御部17はチップの動作を停止させ、コントロールレジスタ16に設されているデータ転送元の内容を転送レジスタ6へ転送させる。このデータ転送が終了すると、割り込み制御部17はPINTフラグを設定する。次に、外部からJTAGアクセスを用いてフラグレジスタ5の内容をモニタすることによりPINTフラグのセットを確認した後、JTAGアクセスを用いて転送レジスタ6の内容をチップ外部へ読み出す。以上により、読み出し動作が完了する。
【0018】
【発明が解決しようとする課題】
ところで、上述のような従来のデバッグ装置においては以下の二点の問題点が課題として考えられる。第一は、データの書き込み,読み出しに際して、転送レジスタ6にプログラムメモリ9,内部レジスタ10,内部メモリ11のいずれを接続するかをハードウェア(コントロールレジスタ16)で設定しているため、ハードウェア資源の増大を招来している。更に、上述の接続の組み合わせに応じてそのハードウェア(コントロールレジスタ16)のビット幅を拡大する必要があるため、より一層のハードウェア資源の増大を招来している。
【0019】
第二は、データ読み出し時に、レジスタ,メモリから転送レジスタ6へのデータ転送終了の検知に専用のハードウェア (割り込み制御部17) が必要であるために、上述同様にハードウェア資源の増大を招来し、しかもその制御が複雑である。
【0020】
本発明はこのような事情に鑑みてなされたものであり、テスト及びデバッグに必要なハードウェア資源の増大を抑制し、しかもデータの書き込み先,読み出し元をソフトウェアで設定することにより、柔軟な設定を可能としたデバッグ装置の提供を目的とする。
【0021】
【課題を解決するための手段】
本発明に係るデバッグ装置は、基本的には、外部入力信号に応じて動作する制御回路と、制御回路に制御されたアクセスにより所定の命令の外部からの入力が可能な命令レジスタと、命令レジスタの内容をデコードする命令デコーダと、制御回路に制御されたアクセスによりその内容の外部への出力が可能であり、実行されるべきプログラムアドレスを生成するプログラムカウンタと、プログラムカウンタの値に従ってアクセスされるプログラムメモリとを備え、プログラムメモリは、特定の処理の終了後に所定のアドレス以降のアドレスを実行しない一時休止処理を含むプログラムを格納していることを特徴とする。そして、所定の命令が命令デコーダによりデコードされた場合に制御回路がプログラムカウンタをアクセスしてその値を外部へ出力させることにより、一時休止処理のアドレスが出力された場合に特定の処理の終了が検知される。
【0022】
また、本発明に係るデバッグ装置は、上述の基本構成を実現するために、プログラムメモリに格納されている一時休止処理が、特定の処理の終了後に所定のアドレス間をループするプログラムであること、または特定の処理の終了後に特定のアドレスでプログラムの実行を待機するプログラムであることを特徴とする。従って、特定の処理が終了した後は所定のアドレス間をループするプログラムまたはプログラムの実行を待機するプログラムのアドレスが外部へ出力されるので、特定の処理の終了が検知される。
【0023】
また、本発明に係るデバッグ装置は、制御回路に制御されたアクセスにより外部から入力された信号の値の保持が可能な第1のレジスタ(DINTレジスタ)と、第1のレジスタ(DINTレジスタ)に保持された信号値を任意のタイミングで外部から入力される信号に同期して保持し、この値に従って一時休止処理を解除する第2のレジスタ(フラグレジスタ)とを備えたことを特徴とする。これにより、特定の処理が終了した後に一旦プログラムの実行が停止するが、その後にプログラムを再実行することが可能になる。
【0024】
また更に、本発明に係るデバッグ装置は、制御回路に制御されたアクセスによりその内容の外部への出力が可能であると共に、複数の記憶手段(内部レジスタ,内部メモリ)と接続可能な転送レジスタを備え、プログラムメモリは、転送レジスタと接続可能な複数の記憶手段(内部レジスタ,内部メモリ)の内の少なくとも一部と転送レジスタとの間の転送プログラムを格納していることを特徴とする。そして、所定の命令が命令デコーダによりデコードされた場合に制御回路が転送レジスタをアクセスしてその値を外部へ出力させることにより、転送レジスタと接続可能な複数の記憶手段(内部レジスタ,内部メモリ)の内の少なくとも一部の内容の外部への出力が可能になる。
【0025】
更に、本発明に係るデバッグ装置は、プログラムメモリの一部に、転送レジスタと接続し、プログラムカウンタの値によりアクセス可能であり且つ書き込み,読み出し可能な領域を有していることを特徴とする。従って、制御回路の制御により転送レジスタをアクセスすることにより、書き込み,読み出し可能なプログラムメモリ(RAM領域) に外部から任意のプログラムの書き込みが可能になる。具体的には、デバッグ対象のレジスタ, メモリ等と転送レジスタとの間の転送プログラムを外部から書き込み,読み出し可能なプログラムメモリ(RAM領域) に書き込むことにより、デバッグ対象を任意に選択することが可能になる。
【0026】
【発明の実施の形態】
〔実施の形態1〕
以下、本発明をその実施の形態を示す図面に基づいて詳述する。図1は本発明に係るデバッグ装置の一構成例を示すブロック図であり、 LSIチップとして集積した場合に本発明のデバッグ装置を実現する場合に最小限必要な構成要素が示されている。
【0027】
図1において、参照符号1はJTAGがIEEE標準1149.1で定めているテストアーキテクチャ及びテストインタフェイスに準拠したテストアクセスポート(TAP:Test Access Port)コントローラ(以下、 TAPコントローラと言う)を示している。この TAPコントローラ1制御回路として機能し、外部から入力端子54に与えられるTCK(Test Clock) 信号, 入力端子55に与えられるTMS(Test Mode Select) 信号及び入力端子53に与えられるTRST(Test ReSet)信号に従って、後述する図2の状態遷移図に示されているように状態遷移する。そして、この TAPコントローラ1による遷移状態と後述する命令デコーダ3による命令コードのデコード結果の信号に従って生成される制御信号は後述する命令レジスタ2, DINTレジスタ4, 転送レジスタ6, プログラムカウンタ7, マルチプレクサ8に与えられている。
【0028】
命令レジスタ2はNビットの外部からのシリアル入力であるTDI(Test Data Input)信号の入力端子51とNビットの外部へのシリアル出力であるTDO(Test Data Output) 信号の出力端子52との間に構成されるJTAGにより定められているプロトコルによりアクセス可能なNビットのスキャンパス上に位置している。なお、以下の説明では、JTAGにより定められているプロトコルによりアクセスすることをJTAGアクセスと言う。そして、命令レジスタ2は、外部から TDI信号として入力されたテスト命令をこのスキャンパスを経由して格納する。なお、 TDI信号の入力端子51と TDO信号の出力端子52との間に構成されるスキャンパス上にはこの命令レジスタ2の他にDINTレジスタ4, 転送レジスタ6及びプログラムカウンタ7が位置している。
【0029】
命令デコーダ3は、命令レジスタ2の内容、即ち命令レジスタ2に格納されている命令コードをデコードし、その結果得られた信号を TAPコントローラ1に与える。この命令デコーダ3がデコードする命令には、IEEE標準の1149.1(1990)で定義されている3種類の必須命令の他にテスト及びデバッグに必要なプライベート命令も含まれている。
【0030】
DINTレジスタ4は第1のレジスタとして機能し、JTAGアクセス可能なNビットのスキャンパスを通じてアクセス可能であり、外部からJTAGアクセスを行なうことによりPCブレイク信号であるデバッガ割り込み(DINT)信号を入力して保持する。このDINTレジスタ4に保持されたDINT信号は後述する2入力の論理和ゲート (ORゲート) 14に与えられている。
【0031】
参照符号5はチップ内部の状態を記憶するための第2のレジスタとして機能するフラグレジスタを示している。このフラグレジスタ5には上述の論理和ゲート14の論理和出力信号が与えられている。論理和ゲート14にはチップ外部から入力端子56に入力されるピン入力信号DINTと前述のDINTレジスタ4の出力信号とが入力されている。なお、フラグレジスタ5はローカルバス13を介して転送レジスタ6及びプログラムカウンタ7と接続されている。
【0032】
転送レジスタ6は、上述のJTAGアクセス可能なNビットのスキャンパスを通じてアクセス可能である。換言すれば、外部から転送レジスタ6に対してJTAGアクセスを行なうことにより、転送レジスタ6を経由して内部のレジスタ,メモリへのアクセスが可能である。具体的には、転送レジスタ6は後述するプログラムメモリ9, 内部レジスタ10及び内部メモリ11とは内部バス12を介して相互に接続されており、更にフラグレジスタ5及びプログラムカウンタ7ともローカルバス13を介して相互に接続されている。なお、内部バス12は入出力ポート15とも接続されている。
【0033】
プログラムカウンタ7は、JTAGアクセス可能なNビットのスキャンパスを通じてアクセス可能であり、プログラムメモリ9から読み出されるべき命令コードのアドレスを生成して保持する。
【0034】
マルチプレクサ8は、Nビットのスキャンパス出力の内の一つ、即ち命令レジスタ2,DINTレジスタ4,転送レジスタ6及びプログラムカウンタ7の出力の内の一つを TAPコントローラ1の制御により選択し、 TDO信号としてシリアル出力する。
【0035】
プログラムメモリ9は、前述の如く、内部バス12を介して転送レジスタ6との間でデータの転送が可能であり、このチップが実行すべきプログラムを格納する。なお、プログラムメモリ9は本質的にはROM であるが、書き込み,読み出し可能な領域としての RAM領域91が設けられている。
【0036】
内部レジスタ10はチップ内に通常備えられている一つまたは複数個のレジスタであり、前述の如く、内部バス12を介して転送レジスタ6との間でデータの転送が可能である。内部メモリ11はチップ内に通常備えられている一つまたは複数個のメモリであり、前述の如く、内部バス12を介して転送レジスタ6との間でデータの転送が可能である。
【0037】
次に、上述の本発明のデバッグ装置の構成要素の入力信号及び出力信号について説明する。
【0038】
TCK(Test ClocK)信号は TAPコントローラ1への入力信号であり、テストアクセスポート用のクロック信号である。 TMS(Test Mode Select)信号は TAPコントローラ1への入力信号であり、 TAPコントローラ1の状態遷移を制御する。TDI(Test Data Input)信号は命令レジスタ2及びJTAGアクセス可能なスキャンパスを有するテストデータレジスタ (DINTレジスタ4, 転送レジスタ6, プログラムカウンタ7等、以下、テストデータレジスタ4, 6, 7等と言う) へのシリアル入力信号である。
【0039】
TDO(Test Data Output) 信号は命令レジスタ2及びJTAGアクセス可能なスキャンパスを有するテストデータレジスタ4, 6, 7等からのシリアル出力信号である。TRST(Test ReSeT)信号は TAPコントローラ1への入力信号であり、 TAPコントローラ1のリセット入力信号である。ピン入力DINT信号は論理和ゲート14への入力信号であり、デバッガ割り込み入力信号である。PCブレイクDINT信号はDINTレジスタ4への入力信号であり、プログラムメモリ9に設定されたブレイクポイントによるブレイク条件成立時に”1”になる信号である。
【0040】
なお、これらの TAPコントローラ1への入出力信号は実際にはいずれも図示されていないホストコンピュータから入力され、ホストコンピュータへ出力される。
【0041】
次に、上述の図1に示されている本発明のデバッグ装置の各構成要素について、より具体的に説明する。
【0042】
TAPコントローラ1は TCK信号のクロックの全ての立ち上がりエッジにおける TMS信号の値に従って状態遷移を行ない、図2に示されている16の状態の内のいずれかの状態をとる。命令レジスタ2及びテストデータレジスタ4, 6, 7等の回路は TCK信号のクロックの立ち上がりと立ち下がりとの両方のエッジで動作する。以下、 TAPコントローラ1による状態遷移の個々の状態について、以下に具体的に説明する。
【0043】
*Test-Logic-Reset状態
リセット状態。この状態ではチップの通常の動作は妨げられない。 TAPコントローラ1がこの状態へ遷移する際には、命令レジスタ2の出力ラッチ (図3参照) に強制的にBYPASS命令(b'11111) がロードされる。なお、命令レジスタ2, DINTレジスタ4, 転送レジスタ6, プログラムカウンタ7の詳細な構成に関しては後述する。また、「b'」は2進表示であることを示し、本実施の形態においては命令コードは5ビットである。 TAPコントローラ1は初期状態には拘らず、TRST信号がアサートされるか、または TMS信号が TCK信号の5クロックの期間以上にわたってb'1 に維持されるとこのTest-Logic-Reset状態へ遷移し、その後は TMS信号がb'1 を維持する限りはこのTest-Logic-Reset状態を保持する。但し、 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると、 TAPコントローラ1はRun-Test/Idle 状態へ遷移する。
【0044】
*Run-Test/Idle 状態
テスト命令実行状態。この状態ではスキャン動作は行なわれず、命令レジスタ2に保持された命令に従って指定された動作が実行される。この状態では命令は変化しない。 TAPコントローラ1は TMS信号がb'0 を維持する限りはこの状態を保持する。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると、 TAPコントローラ1はSelect-DR-Scan状態へ遷移する。なお、「DR」はテストデータレジスタ4, 6, 7等を表している。
【0045】
*Select-DR-Scan状態
他の状態へ遷移するためのテンポラリ状態。テストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。この状態では TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は Captur-DR状態へ遷移し、命令で指定されたテストデータレジスタ4, 6, 7等のスキャン動作が開始される。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はSelect-IR-Scan状態へ遷移する。なお、「IR」は命令レジスタ2を表している。
【0046】
*Select-IR-Scan状態
他の状態へ遷移するためのテンポラリ状態。テストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。この状態では TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は Captur-IR状態へ遷移し、命令レジスタ2のスキャン動作が開始される。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1は前述のTest-Logic-Reset状態へ遷移する。
【0047】
* Captur-DR状態
テストデータレジスタ4, 6, 7等のシフトレジスタ段に外部から値を取り込む状態。 TCK信号のクロックの立ち上がりエッジにおいて、現在の命令で指定されたいずれかのテストデータレジスタ4, 6, 7等にそのパラレル入力ポートからデータがロードされる。指定されたテストデータレジスタ4, 6, 7等がパラレル入力ポートを有していない場合、または命令でパラレル入力が指示されない場合にはテストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1はShift-DR状態へ遷移し、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit1-DR状態へ遷移する。
【0048】
*Shift-DR状態
テストデータレジスタ4, 6, 7等のスキャン動作を行なう状態。現在の命令で指定されたいずれかのテストデータレジスタ4, 6, 7等が TDI信号の入力端子51と TDO信号の出力端子52との間に構成されるスキャンパスに接続され、 TCK信号のクロックの立ち上がりエッジ毎にデータが1ビットずつシリアル出力方向へシフトされる。この状態では命令は変化しない。 TAPコントローラ1は TMS信号がb'0 を維持する限りはこの状態を保持する。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit1-DR状態へ遷移する。
【0049】
*Exit1-DR状態
他の状態へ遷移するためのテンポラリ状態。テストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1は Update-DR状態へ遷移してスキャンプロセスを終了する。 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1はPause-DR状態へ遷移する。
【0050】
*Pause-DR状態
テストデータレジスタ4, 6, 7等のシフト動作を一時的に停止させる状態。テストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。 TAPコントローラ1は TMS信号がb'0 を維持する限りはこの状態を保持する。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit2-DR状態へ遷移する。
【0051】
*Exit2-DR状態
他の状態へ遷移するためのテンポラリ状態。テストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はスキャンプロセスを終了して Update-DR状態へ遷移する。 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は前述のShift-DR状態へ遷移する。
【0052】
* Update-DR状態
テストデータレジスタ4, 6, 7等の出力ラッチを更新する状態。 TCK信号のクロックの立ち下がりエッジにおいてテストデータレジスタ4, 6, 7等のシフトレジスタからパラレル出力ラッチへデータが転送されるが、シフトレジスタはそれまでの値を保持する。テストデータレジスタ4, 6, 7等のパラレル出力ラッチはテストデータレジスタ4, 6, 7等がスキャン動作を行なっている間にパラレル出力の値が変化しないようにするために備えられている。この状態では命令は変化しない。この状態で TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1は前述のSelect-DR-Scan状態へ遷移し、 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は前述のRun-Test/Idle 状態へ遷移する。
【0053】
* Captur-IR状態
命令レジスタ2のシフトレジスタ段に固定値を取り込む状態。本実施の形態では、 TCK信号のクロックの立ち上がりエッジにおいて命令レジスタ2のパラレル入力ポートから固定値b'00001 がロードされる。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持し、命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1はShift-IR状態へ遷移し、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit1-IR状態へ遷移する。
【0054】
*Shift-IR状態
命令レジスタ2のスキャン動作を行なう状態。命令レジスタ2が TDI信号の入力端子51と TDO信号の出力端子52との間に構成されるスキャンパスに接続され、 TCK信号のクロックの立ち上がりエッジ毎にデータが1ビットずつシリアル出力方向へシフトされる。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持し、命令は変化しない。 TAPコントローラ1は TMS信号がb'0 を維持する限りはこの状態を保持する。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit1-IR状態へ遷移する。
【0055】
*Exit1-IR状態
他の状態へ遷移するためのテンポラリ状態。命令レジスタ2はそれまでの値を保持する。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持し、命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1は Update-IR状態へ遷移してスキャンプロセスを終了する。 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1はPause-IR状態へ遷移する。
【0056】
*Pause-IR状態
命令レジスタ2のシフト動作を一時的に停止する状態。命令レジスタ2はそれまでの値を保持する。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持し、命令は変化しない。 TAPコントローラ1は TMS信号がb'0 を維持する限りはこの状態を保持する。 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はExit2-IR状態へ遷移する。
【0057】
*Exit2-IR状態
他の状態へ遷移するためのテンポラリ状態。命令レジスタ2はそれまでの値を保持する。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持し、命令は変化しない。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1はスキャンプロセスを終了して Update-IR状態へ遷移する。 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は前述のShift-IR状態へ遷移する。
【0058】
* Update-IR状態
命令レジスタ2の出力ラッチを更新する状態。 TCK信号のクロックの立ち下がりエッジにおいて命令レジスタ2のシフトレジスタからパラレル出力ラッチへデータが転送される。命令レジスタ2の出力ラッチに新しい命令がラッチされるとそれが現在の命令になる。この状態ではテストデータレジスタ4, 6, 7等はそれまでの値を保持する。この状態では、 TCK信号のクロックの立ち上がりエッジにおいてb'1 の TMS信号が入力されると TAPコントローラ1は前述のSelect-DR-Scan状態へ遷移し、 TCK信号のクロックの立ち上がりエッジにおいてb'0 の TMS信号が入力されると TAPコントローラ1は前述のRun-Test/Idle 状態へ遷移する。
【0059】
以上の16状態の内のいずれかを TAPコントローラ1はとるが、それらの内のPuase-DR状態及びPuase-IR状態は命令レジスタ2またはテストデータレジスタ4, 6, 7等にデータをシフトインしている間に一時的に動作を停止させるために必要であり、たとえば自動テスト装置(Automatic Test Equipment)がディスクからメモリに長いテストシーケンスをロードするような場合に必要である。
【0060】
TAPコントローラ1はテストのために3種類の基本的な動作を行なう。その3種類の動作とは信号入力(Update-DR),実行(Run-Test/Idle),結果取り込み(Captur-DR) の各状態である。但し、これらのテスト動作は全てのテストにおいて全てが必ずしも必要ということではない。
【0061】
マルチプレクサ8内の TDO信号出力のためのドライバは TAPコントローラ1がShift-IR状態またはShift-DR状態である場合にのみb'1 またはb'0 をドライブし、その他の状態である場合にはハイインピーダンス状態になる。
【0062】
次に命令レジスタ2の構成について、その一構成例を示す図3のブロック図を参照して説明する。本実施の形態では、命令レジスタ2は全体としては各1ビット分のセルを下位ビット側のシリアル出力を上位ビット側のシリアル入力へそれぞれ接続することにより5ビット幅のレジスタとして構成されており、大きくはパラレル入力, シリアル入力及びシリアル出力を有するシフトレジスタ段と、パラレル出力を有し、現在実行中の命令を保持する出力ラッチとの二段構成を採っている。
【0063】
命令レジスタ2を構成する個々のセルの内部構成は同一であり、図3のブロック図に参照符号200 にて示されている。具体的には、命令レジスタ2の各セル200 のシフトレジスタ段はマルチプレクサ231 とフリップフロップ232 とで構成され、出力ラッチはフリップフロップ233 で構成されている。シフトレジスタ段を構成するマルチプレクサ231 はパラレル入力及びシリアル入力を有し、 Shift/#Captur信号、即ち TAPコントローラ1がShift-DR状態またはShift-IR状態において出力する Shift信号と、 TAPコントローラ1が Captur-DR状態または Captur-IR状態において出力する信号の反転信号である #Captur信号に応じていずれかをフリップフロップ232 へ出力する。フリップフロップ232 は、 TCK信号をトリガ信号としてマルチプレクサ231 の出力信号をラッチし、シリアル出力として次段のセルまたは TDO信号として外部へ出力する。フリップフロップ233 は、 Update-IR信号をトリガ信号としてフリップフロップ232 の出力をラッチし、それを命令デコーダ3へパラレル出力する。
【0064】
従って、 TDI信号が命令レジスタ2の初段のセル200 のマルチプレクサ231 へ入力されてフリップフロップ232 からの出力信号が次段のセル200 のマルチプレクサ231 に入力される動作が反復されて、というようにして最終段のセル200 のフリップフロップ232 からの出力信号が TDO信号としてマルチプレクサ8へ出力される。また、各セル200 のフリップフロップ233 からの出力は5ビットのパラレル出力として命令デコーダ3に入力される。
【0065】
このような構成の命令レジスタ2では、初段のセル200 へのシリアル入力と最終段のセル200 からのシリアル出力が図1の TDI信号の入力端子51と TDO信号の出力端子52 (マルチプレクサ8) との間で5ビットシリアルのスキャンパスを形成する。そして、このようなスキャンパスでは、 TAPコントローラ1がShift-IR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して各セル200 が順次データを転送する。各セル200 のマルチプレクサ231 へのパラレル入力からは TAPコントローラ1が Captur-IR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して固定値b'00001 の各ビットがロードされる。なお、この固定値はb'1 がLSB であり、最終段のセル200 にロードされる。各セル200 のシフトレジスタ段のフリップフロップ232 に保持された命令コードのビットは TAPコントローラ1が Update-IR状態である場合の TCK信号のクロックの立ち下がりに同期して出力ラッチを構成するフリップフロップ233 へ転送される。また、各セル200 のパラレル出力ラッチには TAPコントローラ1がTest-Logic-Reset状態に遷移した場合にリセットされて TCK信号のクロックの立ち下がりに同期してb'11111(BYPASS命令) がセットされ、TRST信号がアサートされた場合は TCK信号のクロックとは非同期にb'11111(BYPASS命令) がセットされる。
【0066】
以上のような TAPコントローラ1の各状態における命令レジスタ2の動作を図4の一覧図にまとめて示す。
【0067】
命令デコーダ3がデコードする命令は、IEEE標準1149.1(1990)で定義されている3つの必須の命令以外にも4つのプライベート命令をサポートする。テスト命令は全て5ビットのコードを有し、各命令のビットパターンと使用するスキャンレジスタとを図5の一覧図に示す。なお、図5においては、命令コードは16進表示されている。なお、以下の説明では、16表示であることをh'で示す。
【0068】
図5に示されている命令の内のBYPASS命令 (命令コードh'1F),SAMPLE/PRELOAD命令 (命令コードh'02) 及びEXTEST命令 (命令コードh'00) が必須命令であるが、本発明とは直接の関係は無いのでそれらの詳細は省略する。なお、BYPASS命令はバイパスレジスタを動作させる必須の標準命令であり、SAMPLE/PRELOAD命令とEXTEST命令とはバウンダリスキャンレジスタを動作させる必須の標準命令であってバウンダリスキャンレジスタ命令と呼ばれる。
【0069】
本発明に特有な命令は、 SETDINT命令 (命令コードh'16),RD_PC命令 (命令コードh'0C),RD_Trans 命令 (命令コードh'0E) 及びWR_Trans 命令 (命令コードh'0F) である。 SETDINT命令 (命令コードh'16) はプログラムのデバッグ時にデバッガとモニタプログラムとのコミュニケーションを行なうための命令である。RD_PC命令 (命令コードh'0C) はプログラムカウンタ7のラッチの出力をサンプリングするための命令である。RD_Trans 命令 (命令コードh'0E),及びWR_Trans 命令 (命令コードh'0F) はそれぞれ転送レジスタ6に対するサンプリング, 書き込みを行なう命令である。以上の4つのプライベート命令の使用方法の詳細に関しては本発明のデバッグ装置の動作説明の際に説明する。
【0070】
図6はDINTレジスタ4の構成例を示すブロック図である。DINTレジスタ4は1ビットレジスタであり、図1の TDI信号とDINT信号とを入力し、 Shift/#Captur信号によりいずれかを出力するマルチプレクサ431 と、このマルチプレクサ431 の出力信号を TCK信号をトリガ信号としてラッチするフリップフロップ432 と、論理積ゲート436 の出力信号をトリガ信号としてフリップフロップ432 の出力信号をラッチするフリップフロップ433 と、フリップフロップ433 の出力信号とDINT信号とを入力し、 SETDINT信号によりいずれかを出力するマルチプレクサ434 と、 SETDINT信号と Update-DR信号とを入力する上述の論理積ゲート436 とで構成されている。
【0071】
マルチプレクサ431 へのシリアル入力は図1の TDI信号であり、これがフリップフロップ432 に一旦ラッチされた後に出力信号としてマルチプレクサ8へシリアル出力されるとにより、1ビットのスキャンパスが形成される。このスキャンパスでは、 TAPコントローラ1がShift-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、マルチプレクサ431 へのシリアル入力からのデータをフリップフロップ432 が取り込み、シリアル出力へデータ転送する。一方、DINT入力からは、 TAPコントローラ1が Captur-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、図1のPCブレイクDINT信号をフリップフロップ432 が取り込み、シリアル出力へデータ転送する。更に、フリップフロップ433,マルチプレクサ434,論理積ゲート436 によって、 SETDINT命令で TAPコントローラ1が Update-DR状態である場合の TCK信号のクロックの立ち下がりに同期して、フリップフロップ432 の値がフリップフロップ433 に取り込まれ、マルチプレクサ434 のDINT出力から図1の論理和ゲート14へ出力される。 SETDINT命令以外の場合には、DINT出力へは図1のPCブレイクDINTの値が出力される。
【0072】
フラグレジスタ5は、一般的なコンピュータのそれと同様に、 LSIチップ内部の種々の状態を格納する複数ビット幅のレジスタである。この種々の状態には、演算結果のキャリー, オーバフロー等のフラグが含まれる他、本実施の形態に関連するDINT (デバッガ割り込み) 等の割り込み等の必要な状態の数に応じたビット幅が必要である。本実施の形態においてはこれらの内のDINTの1ビットのみが関係する。DINTビットは、ローカルバス13にも接続されており、DINTレジスタ4によるアクセス以外にローカル バス13を介したアクセスも可能である。
【0073】
図7は転送レジスタ6の1ビット分のセルの構成例を示すブロック図である。転送レジスタ6はJTAGアクセスが可能であり、ローカルバス13及び内部バス12に接続されているため、転送レジスタ6に対してチップ外部からJTAGアクセスすることにより、ローカルバス13及び内部バス12に接続される全てのチップ内部のレジスタ, メモリのアクセスがチップ外部から可能になる。
【0074】
転送レジスタ6の各1ビット分のセル600 は、パラレルデータを保持するデータラッチ630,シリアルデータを保持するシフトレジスタ段 (フリップフロップ632)及びシリアルデータをデータラッチ630 へ転送する出力ラッチ (フリップフロップ633)のラッチ類と、マルチプレクサ631, 634, 635 及び論理積ゲート636 とで構成される。
【0075】
マルチプレクサ635 にはパラレル入力とマルチプレクサ634 の出力とを入力し、WR_Trans 命令により TAPコントローラ1が出力するWR_Trans 信号に応じていずれかをデータラッチ630 へ出力する。マルチプレクサ631 にはデータラッチ630 の保持値とシリアル入力とが入力され、 Shift/#Captur信号に応じていずれかを出力する。フリップフロップ632 は TCK信号にをトリガとしてマルチプレクサ631 の出力をラッチしてシリアル出力として出力する。フリップフロップ633 は論理積ゲート636 の出力信号をトリガとしてフリップフロップ632 のシリアル出力をラッチして出力する。マルチプレクサ634 にはフリップフロップ633 の出力信号とデータラッチ630 の保持値とが入力され、WR_Trans 命令により TAPコントローラ1が出力するWR_Trans 信号に応じていずれかをマルチプレクサ635 へ出力する。なお、論理積ゲート636 にはWR_Trans 信号とUpdate-DR 状態において TAPコントローラ1が出力するUpdate-DR 信号とが入力される。
【0076】
本実施の形態の転送レジスタ6は図7に示されているセル600 を各ビットとする16ビットのレジスタである。各セル600 は、下位ビット側のフリップフロップ632 のシリアル出力が上位ビット側のマルチプレクサ631 のシリアル入力にそれぞれ接続されることにより16ビット幅に構成され、図1に示されているように、 TDI信号の入力端子51と TDO信号の出力端子62 (マルチプレクサ8) との間で16ビットのスキャンパスを形成する。
【0077】
このスキャンパスでは、マルチプレクサ631 及びフリップフロップ632 によって、 TAPコントローラ1がShift-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、マルチプレクサ631 のシリアル入力からフリップフロップ632 のシリアル出力へデータが転送されると同時にフリップフロップ632 の出力データがフリップフロップ632 に取り込まれる。データラッチ630 の出力であるパラレル出力からは、 TAPコントローラ1が Captur-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、データラッチ630 の保持値がマルチプレクサ631 を経由してフリップフロップ632 にロードされる。フリップフロップ633,マルチプレクサ634,論理積ゲート636,マルチプレクサ635 によって、フリップフロップ632 に保持されている値はWR_Trans 命令で TAPコントローラ1が Update-DR状態である場合の TCK信号のクロックの立ち下がりに同期してフリップフロップ633 に取り込まれ、マルチプレクサ634 及び635 を経由してデータラッチ630 に入力される。WR_Trans 命令以外の場合には、 TDI信号であるパラレル入力がマルチプレクサ635 経由してデータラッチ630 に入力される。
【0078】
図8はプログラムカウンタ7の1ビット分のセルの構成例を示すブロック図である。プログラムカウンタ7は、その機能に関しては一般的なコンピュータのそれと同様に、インクリメント, ジャンプ, ループ等の機能を有しており、このカウント値 (PC値) をアクセスアドレスとしてプログラムメモリ9をアクセスすることにより、命令コードが出力される。但し、本発明においては、プログラムカウンタ7の本来の機能は重要ではなく、プログラムカウンタ7の値がJTAGアクセス可能であり、チップ外部からモニタ可能であることが重要である。
【0079】
本実施の形態のプログラムカウンタ7は図8に示されているセル700 を各ビットとする16ビットのレジスタである。プログラムカウンタ7の各セル700 は、インクリメント, ジャンプ, ループ等の処理後のパラレルデータを保持するデータラッチ730 及びシリアルデータを保持するシフトレジスタ段 (フリップフロップ732)のラッチ類と、マルチプレクサ731 とで構成されている。
【0080】
データラッチ730 にはパラレル入力が入力され、マルチプレクサ731 にはデータラッチ730 の保持値とシリアル入力とが入力され、 #Shift/Captur信号、即ち TAPコントローラ1がShift-DR状態またはShift-IR状態において出力する信号の反転信号である#Shift信号と、 TAPコントローラ1が Captur-DR状態または Captur-IR状態において出力するCaptur信号に応じていずれかをフリップフロップ232 へ出力する。フリップフロップ732 は TCK信号をトリガとしてマルチプレクサ731 の出力信号をラッチしてシリアル出力として出力する。
【0081】
そして、各セル700 は、下位ビット側のフリップフロップ732 のシリアル出力が上位ビット側のマルチプレクサ731 のシリアル入力にそれぞれ接続されることにより16ビット幅に構成され、図1に示されているように、 TDI信号の入力端子51と TDO信号の出力端子52 (マルチプレクサ8) との間で16ビットのスキャンパスを形成する。
【0082】
このスキャンパスでは、マルチプレクサ731 及びフリップフロップ732 によって、 TAPコントローラ1がShift-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、マルチプレクサ731 のシリアル入力からフリップフロップ732 のシリアル出力へデータが転送されると同時にフリップフロップ732 がデータを取り込む。データラッチ730 の出力であるパラレル出力からは、 Captur-DR状態に遷移した後の TCK信号のクロックの立ち上がりに同期して、データラッチ730 の値がフリップフロップ732 へロードされる。
【0083】
マルチプレクサ8は、 TAPコントローラ1がShift-IR状態及びShift-DR状態である場合にのみハイレベルまたはローレベルの信号、換言すればb'1 またはb'0 の信号をドライブする。マルチプレクサ8は、 TAPコントローラ1がShift-IR状態である場合には、命令レジスタ2の最終段のシリアル出力を選択して TDO信号として出力する。また、マルチプレクサ8は、 TAPコントローラ1がShift-DR状態でああり、且つ SETDINT命令が実行される場合にはDINTレジスタ4のシリアル出力を選択し、RD_PC命令が実行される場合にはプログラムカウンタ7の最終段のシリアル出力を選択し、RD_Trans 命令, WR_Trans 命令が実行される場合には転送レジスタ6最終段のシリアル出力を選択し、それぞれ TDO信号として出力する。なお、 TAPコントローラ1がその他の状態である場合には、マルチプレクサ8はハイインピーダンス状態となる。
【0084】
プログラムメモリ9は、その機能に関しては一般的なコンピュータのそれと同様に、コンピュータが処理を実行する際に必要なプログラムの命令コードを格納するメモリであり、プログラムカウンタ7が指示するアドレス値に従って命令コードを格納する。但し、本発明のデバッグ装置においては、図9のフローチャートに示されているモニタプログラムがプログラムメモリ9の特定の位置に格納されている必要がある。
【0085】
この図9に示されているモニタプログラムは、フラグレジスタ5のDINTビットにb'1 がセットされた場合、換言すればDINT割り込みが発生した場合に実行される。これは、フラグレジスタ5のDINTビットにb'1 がセットされた場合に、プログラムカウンタ7のPC値をモニタプログラムの先頭番地にジャンプさせることで容易に実現可能である。但し、ジャンプする前のアドレスをなんらかの記憶手段に記憶しておき、そのアドレスへモニタプログラム実行後のリターン時に戻れるようにしておくこと、いわゆるコンテキストロード/リストアも必要である。更に、このDINT割り込みの発生によるモニタプログラムの実行開始時点からリターンするまでの期間は、フラグレジスタ5またはプログラムカウンタ7が多重のDINT割り込みを受け付けないように機構的な工夫をする必要がある。
【0086】
内部レジスタ10は、内部バス12を介して転送レジスタ6と接続する複数個のレジスタである。プログラムにより転送レジスタ6との間でデータの転送が可能である。
【0087】
内部メモリ11は、内部バス12を介して転送レジスタ6と接続する複数個のメモリである。プログラムにより転送レジスタ6との間でデータの転送が可能である。
【0088】
内部バス12は、転送レジスタ6をプログラムメモリ9, 内部レジスタ10及び内部メモリ11と接続している。ローカルバス13は、転送レジスタ6をフラグレジスタ5及びプログラムカウンタ7と接続している。
【0089】
論理和ゲート14は、チップ外部から設定されるピン入力DINT信号とDINTレジスタ3の出力信号との論理和演算を行なう論理ゲートであり、その結果はフラグレジスタ5に与えられている。
【0090】
入出力ポート15は、内部バス12と接続しており、図1に示されている本発明のデバッグ装置の LSIチップ外部のメモリ等を接続することが可能である。入出力ポート15により、プログラムによる転送レジスタ6と LSIチップ外部のメモリ等との間でのデータの転送が可能である。
【0091】
以上のように構成された本発明のデバッグ装置の動作について以下に説明する。なお、本実施の形態は、上述の構成を最低限有する LSIチップと、この LSIチップとTDI, TDO, TCK, TMS, (TRST)の4本(5本) の信号線で接続されるホストコンピュータとからなるデバッグ装置のハンドシェイクに関するものであり、以下の動作の説明では、図1に示されている本発明のデバッグ装置にホストコンピュータが接続された構成を前提とする。また、ホストコンピュータに関しては、TDI, TDO, TCK, TMS, (TRST)信号のプロトコルが、JTAGで定められているIEEE1149.1標準に準拠していれば、換言すればJTAGアクセス可能であれば特に限定されるものではない。
【0092】
まず、図1に示されている本発明のデバッグ装置にホストコンピュータからどのようにして命令を設定し、それがどのように実行されるかについて、前述の4つのプライベート命令に関して説明する。なお、命令の設定手順はいずれの命令に関しても同様である。前述の図2の状態遷移図において、 TAPコントローラ1が下記の状態遷移を行なうようにホストコンピュータが TMS信号をその値を変化させつつ TAPコントローラ1に入力する。このホストコンピュータから TAPコントローラ1へ入力された TMS信号の値は、 TCK信号のクロックの立ち上がりに同期して TAPコントローラ1にサンプルされる。
【0093】
Test-Logic-Reset → Run-Test/Idle → Select-DR-Scan → Select-IR-Scan → Captur-IR → Shift-IR → … → Shift-IR → Exit1-IR → Update-IR → Run-Test/Idle → …
【0094】
このような状態遷移において、 TAPコントローラ1が Captur-IR状態である間の TCK信号のクロックの立ち上がりに同期して、命令レジスタ2のシフトレジスタ段 (図3に示されている命令レジスタ2の各セル200 のフリップフロップ232)に5ビットの固定値b'00001 の各ビットがパラレルにロードされる。次のShift-IR状態は、命令レジスタ2のビット幅に対応する回数が反復される。
【0095】
本実施の形態では命令レジスタ2のビット幅は前述の如く5ビットであるため、ホストコンピュータが TAPコントローラ1に対して5回連続してb'0 の TMS信号を与えることにより、 TAPコントローラ1がShift-IR状態を5回反復する状態遷移を行なう。この際、ホストコンピュータは、命令コードをその LSBから順に TDI信号として TAPコントローラ1に入力する。具体的には、図3において、命令レジスタ2へ TDI信号として初段のセル200 にシリアル入力されたデータが各セル200 のフリップフロップ232 を介して順次シリアル出力から次段のセル200 のフリップフロップ232 へ出力される。その結果、最終段のセル200 から TDO信号としてb'00001 がシリアル出力される。
【0096】
そして、上述のShift-IR状態が5回反復された後はホストコンピュータはb'1 の TMS信号を2回連続して出力する。これにより、 TAPコントローラ1はExit1-IR状態を経て Update-IR状態に遷移する。 TAPコントローラ1が Update-IR状態である間の TCK信号のクロックの立ち下がりに同期して命令レジスタ2では、各セル200 のシリアルラッチ(フリップフロップ232)にラッチされているデータ(TDI信号として入力されたデータ) がパラレル出力ラッチ (フリップフロップ233)へデータ転送されてラッチされることにより、命令の設定が完了する。
【0097】
このようにして命令レジスタ2に設定された命令は命令デコーダ3へ送られてデコードされ、 TAPコントローラ1の状態遷移に同期して、スキャンパスの選択, テストデータレジスタ4, 6, 7等への書き込み/読み出しの指定, マルチプレクサ8での TDO信号出力の選択, それぞれに必要な信号の生成が行なわれる。以下、前述の4つのプライベート命令が設定されている場合の動作について具体的に説明する。
【0098】
命令レジスタ2に SETDINT命令が設定された場合にはスキャンパスとしてDINTレジスタ4が選択される。そして、 TAPコントローラ1が以下の状態遷移を行なうようにホストコンピュータが TMS信号をその値を変化させつつ TAPコントローラ1に入力する。なお、以下の説明ではすべて、 TMS信号と TCK信号のクロックのタイミングに関しては前述の命令設定の場合と同様である。
【0099】
Run-Test/Idle → Select-DR-Scan → Captur-DR → Shift-DR → Exit1-DR → Update-DR → Run-Test/Idle → …
【0100】
このような状態遷移において、 TAPコントローラ1が Captur-DR状態である間の TCK信号のクロックの立ち上がりに同期して、図6に示されているDINT入力 (PCブレイクDINT入力) の値がDINTレジスタ4のフリップフロップ432 にロードされる。Shift-DR状態では、DINTレジスタ4をDINT状態にセットするために、ホストコンピュータから TDI信号としてb'1 が入力される。DINTレジスタ4は1ビット幅であるため、Shift-DRの遷移回数は1回である。この際、 TDO信号としては現在のDINTの値が出力される。
【0101】
上述の Captur-DR状態から更にShift-DR状態, Exit1-DR状態を経て状態遷移が進んで TAPコントローラ1が Update-DR状態である間の TCK信号のクロックの立ち下がりに同期して、DINTレジスタ4では、シリアルラッチ (フリップフロップ432)にラッチされているデータ(TDIから入力されたデータ) がパラレル出力ラッチ (フリップフロップ433)へデータ転送され、図1に示されている論理和ゲート14を経てフラグレジスタ5へ送られる。これにより、フラグレジスタ5のDINTフラグがセットされる。
【0102】
命令レジスタ2にRD_PC命令が設定された場合にはスキャンパスとしてプログラムカウンタ7が選択される。そして TAPコントローラ1が以下の状態遷移を行なうようにホストコンピュータが TMS信号をその値を変化させつつ TAPコントローラ1に入力する。
【0103】
Run-Test/Idle → Select-DR-Scan → Captur-DR → Shift-DR (16回) → Exit1-DR → Update-DR → Run-Test/Idle → …
【0104】
このような状態遷移において、 TAPコントローラ1が Captur-DR状態である間の TCK信号のクロックの立ち上がりに同期して、その時点のプログラムカウンタ7の値 (PC値) がシリアルラッチにロードされる。具体的には、図8に示されている各セル700 において、データラッチ730 の値がマルチプレクサ731 を介してフリップフロップ732 にロードされる動作が、プログラムカウンタ7は16ビット幅であるため、16個のセル700 のシリアルに接続された16個のシリアルレジスタ (フリップフロップ732)に対して同時に実行される。
【0105】
上述の Captur-DR状態の次のShift-DR状態においてはプログラムカウンタ7に対する書き込みは出来ないので、ホストコンピュータは TDI信号として暫定値h'ffffを出力してプログラムカウンタ7に入力する。但し、この暫定値がどのような値であっても動作には影響しない。そして、Shift-DR状態が16回反復されることにより、先の Captur-DR状態においてプログラムカウンタ7の各セル700 のフリップフロップ732 にロードされていた16ビットのプログラムカウンタ7の値が LSB側から TDO信号としてシリアル出力される。なお、 Update-IR状態では何も起こらない。
【0106】
命令レジスタ2にRD_Trans 命令が設定された場合にはスキャンパスとして転送レジスタ6が選択される。そして、 TAPコントローラ1が以下の状態遷移を行なうようにホストコンピュータが TMS信号をその値を変化させつつ TAPコントローラ1に入力する。
【0107】
Run-Test/Idle → Select-DR-Scan → Captur-DR → Shift-DR (16回) → Exit1-DR → Update-DR → Run-Test/Idle → …
【0108】
このような状態遷移において、 TAPコントローラ1が Captur-DR状態である間の TCK信号のクロックの立ち上がりに同期して、その時点の転送レジスタ6の値がシリアルラッチにロードされる。具体的には、図7に示されている各セル600 において、データラッチ630 の値がマルチプレクサ631 を介してフリップフロップ632 にロードされる動作が、転送レジスタ6は16ビット幅であるため、シリアルに接続された16個のシリアルレジスタに対して同時に実行される。
【0109】
RD_Trans 命令が実行される場合、上述の状態遷移中のShift-DR状態では転送レジスタ6に対する書き込みは行なわないので、ホストコンピュータは TDI信号として暫定値h'ffffを出力して転送レジスタ6に入力する。但し、この暫定値がどのような値であっても動作には影響しない。そして、Shift-DR状態が16回反復されることにより、先の Captur-DR状態において転送レジスタ6の各セル600 のフリップフロップ632 にロードされていた16ビットの値が LSB側から TDO信号としてシリアル出力される。なお、 Update-IR状態では何も起こらない。
【0110】
命令レジスタ2にWR_Trans 命令が設定された場合にも、上述のDR-Trans命令の場合と同様に、スキャンパスとして転送レジスタ6が選択される。そして、 TAPコントローラ1が以下の状態遷移を行なうようにホストコンピュータが TMS信号をその値を変化させつつ TAPコントローラ1に入力する。
【0111】
Run-Test/Idle → Select-DR-Scan → Captur-DR → Shift-DR (16回) → Exit1-DR → Update-DR → Run-Test/Idle → …
【0112】
このような状態遷移において、 TAPコントローラ1が Captur-DR状態である間の TCK信号のクロックの立ち上がりに同期して、その時点の転送レジスタ6の値がシリアルラッチにロードされる。具体的には、図7に示されている各セル600 において、データラッチ630 の値がマルチプレクサ631 を介してフリップフロップ632 にロードされる動作が、転送レジスタ6は16ビット幅であるため、シリアルに接続された16個のシリアルレジスタに対して同時に実行される。
【0113】
上述の Captur-DR状態から次に状態遷移が進んで TAPコントローラ1がShift-DR状態である間は、ホストコンピュータから転送レジスタ6に任意の値を TDI信号として入力することが可能である。この際、16ビットの入力値の LSB側から入力される。一方、Shift-DR状態が16回反復されることにより、先の Captur-DR状態において転送レジスタ6の各セル600 のフリップフロップ632 にロードされていた値が LSB側から TDO信号としてシリアル出力される。
【0114】
上述のShift-DR状態から更に状態遷移が進んでExit1-DR状態を経て TAPコントローラ1が Update-DR状態である間の TCK信号のクロックの立ち下がりに同期して、転送レジスタ6ではシリアルラッチにあるデータ(TDI信号として入力されたデータ) がパラレル出力ラッチへデータ転送され、転送レジスタ6にセットされる。具体的には、図7においてフリップフロップ632 にラッチされたデータがフリップフロップ633 にラッチされ、更にその出力がマルチプレクサ634,マルチプレクサ635 を経てデータラッチ630 にラッチされる。この動作は16ビット分のラッチ全てに対して同時に実行される。
【0115】
本発明のデバッグ装置は上述の4つのプライベート命令を用いてデバッグを行なうが、以下にその詳細を説明する。ところで、一般的にデバッグ装置ではデバッグ対象の LSIチップ内部のレジスタ, メモリの読み出し/書き込みの指定, ブレイクポイント(デバッグを行なうためにプログラムの実行を停止させるPC値) の設定等を行なう必要がある。この際、デバッグ対象の LSIチップとデバッグを行なうホストコンピュータとの間でハンドシェイクを行なう必要がある。
【0116】
LSIチップの動作中においてフラグレジスタ5のDINTフラグがセットされると、プログラムカウンタ7の値 (PC値) は、図9にフローチャートが示されているモニタプログラムが格納されている先頭番地にセットされ、モニタプログラムが実行される。DINTフラグがセットされる条件としては以下の3条件がある。
【0117】
第1の条件: LSIチップのピン入力DINTにb'1 がセットされた場合
第2の条件:PC値によりブレイクした場合
第3の条件: SETDINT命令を実行した場合
【0118】
但し、上述の3条件の内の第2の条件は、プログラムメモリ9の特定アドレスを実行した (実行しようとした) 場合を検知してブレイクさせる条件であり、本発明とは直接の関係は無いので、その詳細に関しては省略する。
【0119】
図9において、モニタプログラムが実行されるとまず最初の手順として、デバッグの実行により破壊される可能性があるレジスタ内容を予め退避させるためのコンテキスセーブが行なわれる (ステップS11)。その後の手順は、転送レジスタ6への書き込みであるか、読み出しであるか、またはモニタプログラムの終了であるかによって異なる。この条件分岐をモニタプログラムで処理するためには、後述するCHCK_DINTルーチン (ステップS12)実行した後、所望の処理を記述したプログラムの先頭アドレスをホストコンピュータから転送レジスタ6に書き込み、その値をプログラムカウンタ(PC)7へ転送する (ステップS13)。これにより所望の処理を記述したアドレスへ処理がジャンプする。
【0120】
まず、転送レジスタ6への書き込みの場合の処理について説明する。この処理は、上述の条件分岐の際にも用いられる。基本的には、所望の値をWR_Trans 命令を用いてホストコンピュータから LSIチップに対して書き込めばよいが、 LSIチップ側の状態を検知し、適宜のタイミングで書き込む必要がある。このタイミング同期のとり方が図11に示されている。
【0121】
図11に示されているように、ホストコンピュータは、WR_Trans 命令を実行する前に、RD_PC命令を発行 (ステップS21)して LSIチップの実行プログラムアドレスを観測する。一方、 LSIチップ側では、上述の図9に示されているようなモニタプログラムを実行しているので、モニタプログラム内の一時休止処理であるCHCK_DINTルーチンに処理が移される (ステップS14)。このCHCK_DINTルーチン (ステップS100) は、図10のフローチャートに示されているように2つのループで構成されており、最初のループ (ステップS101) がDINT→b'0 待ちであり、次のループ (ステップS102) がDINT→b'1 待ちである。CHCK_DINTルーチン (ステップS100) はプログラムメモリ内の固定番地に割り付けられているので、 LSIチップ外部 (ホストコンピュータ) からは、実行中のPC値をRD_PC命令により観測することで、いずれのループを実行しているかを検知することができる。
【0122】
モニタプログラムにおいて、最初のDINT→b'0 待ちループは、フラグレジスタ5のDINTフラグがb'0 になれば解除される。モニタプログラム実行中においては、 SETDINT命令以外の命令発行でDINTフラグはクリアされるので、ホストコンピュータからのRD_PC命令発行により解除され、次のDINT→b'1 待ちループに入る。DINT→b'1 待ちループは、フラグレジスタ5のDINTフラグがb'1 になれば解除される。モニタプログラム実行中においては、 SETDINT命令の命令発行でDINTフラグはセットされ、DINT→b'1 待ちループは解除される。つまり、モニタプログラムは、ホストコンピュータから SETDINT命令が発行されるまでDINT→b'1 待ちループを反復することにより事実上は停止していることになる。
【0123】
ホストコンピュータはRD_PC命令により LSIチップの実行PC値を観測し、モニタプログラムがDINT→b'1 待ちループで停止していることを確認した後、WR_Trans 命令 (ステップS23)により転送レジスタ6へ所望の値を書き込む。
【0124】
ホストコンピュータは転送レジスタ6への所望の値の書き込み終了後、DINT→b'1 待ちループで停止しているモニタプログラムに対して、ループ解除→再スタートさせるために SETDINT命令を発行する (ステップS24)。モニタプログラムはホストコンピュータからの SETDINT命令により、DINT→b'1 待ちループを解除し、プログラムメモリに記述された次の処理を続行する。転送レジスタ6に対する書き込み終了後のモニタプログラムの処理としては、転送レジスタ6に接続するバス (内部バス12, ローカルバス13) を介して転送レジスタ6から転送可能なレジスタやメモリへ転送する処理が考えられる (ステップS15)。
【0125】
これらの処理に必要なプログラムは予めモニタプログラムとして、プログラムメモリ9に格納されている。そのようなプログラムがプログラムメモリ9に格納されていない場合でも、プログラムメモリの RAM領域91へ転送レジスタ6の内容を転送する処理がモニタプログラムに用意されていれば、ホストコンピュータからの転送レジスタ6への書き込み処理を行なうことによりモニタプログラムの追加も可能である。
【0126】
次に、転送レジスタ6からの読み出しの場合の処理について説明する。基本的には、RD_Trans 命令を用いてホストコンピュータが転送レジスタ6の値を読めばよいが、 LSIチップ側の状態を検知し、適宜のタイミングで読み出す必要がある。このタイミング同期のとり方が図12に示されている。
【0127】
図12に示されているように、ホストコンピュータは、RD_Trans 命令を実行する前に、RD_PC命令を発行 (ステップS31)して LSIチップの実行プログラムアドレスを観測する。一方、 LSIチップ側では、上述の図9のようなモニタプログラムを実行しているので、転送レジスタ6へ転送する処理 (ステップS16)を実行した後、モニタプログラム内のCHCK_DINTルーチン (ステップS17)に処理が移される。転送レジスタ6へ転送する処理は、転送レジスタ6に接続するバス (内部バス12, ローカルバス13) を介して転送レジスタ6へ転送出来るレジスタ, メモリから転送する処理が考えられる。
【0128】
これらの処理に必要なプログラムは予めモニタプログラムとしてプログラムメモリに格納されている。そのようなプログラムがプログラムメモリ9に格納されていない場合でも、プログラムメモリの RAM領域91へ転送レジスタ6の内容を転送する処理がモニタプログラムに用意されていれば、ホストコンピュータからの転送レジスタ6への書き込み処理を行なうことにより、モニタプログラムの追加も可能である。
【0129】
ホストコンピュータはRD_PC命令 (ステップS31)により LSIチップの実行PC値を観測し、モニタプログラムがDINT→b'1 待ちループで停止していることを確認した後 (ステップS32)、RD_Trans 命令 (ステップS33)により転送レジスタ6から値を読み出す。ホストコンピュータは転送レジスタ6からの読み出し終了後、DINT→b'1 待ちループで停止しているモニタプログラムに対して、ループ解除→再スタートさせるために SETDINT命令を発行する (ステップS34)。モニタプログラムはホストコンピュータからの SETDINT命令により、DINT→b'1 待ちループを解除しプログラムメモリに記述された次の処理を続行する。
【0130】
以上に説明した転送レジスタ6への書き込み/読み出しの処理の組み合せにより、転送レジスタ6と接続する全てのレジスタ/メモリ (プログラムメモリ9, 内部レジスタ10, 内部メモリ11等) への書き込み/読み出しが可能となる。以上の説明でも少し触れたが、全てのレジスタ/メモリへの書き込み/読み出しを可能とするためには、転送レジスタ6と全てのレジスタ/メモリ間の転送処理をモニタプログラムで用意しておく必要がある。しかし、プログラムメモリ9の RAM領域91へ転送レジスタ6の内容を転送する処理がモニタプログラムに用意されていれば、それらのホストコンピュータからの転送レジスタ6への書き込み処理によりモニタプログラムの追加も可能となる。
【0131】
これらの一連の処理が終了すれば、モニタプログラムは終了し、モニタプログラム実行時にコンテキストセーブしたレジスタ内容を元の状態にリストアし (ステップS18)、モニタプログラム実行前の番地へリターンする。モニタプログラムの終了方法は、ホストコンピュータからの転送レジスタ6への書き込み処理より、転送レジスタ6へモニタプログラム内のコンテキストリストアルーチンの先頭アドレスを書き込む。モニタプログラムは、処理の切れ目においては転送レジスタ6の内容をプログラムカウンタ7へ転送するようにプログラムされているため、転送レジスタ6に書き込まれたアドレスへジャンプする。この場合、コンテキストリストアルーチンへジャンプし、モニタプログラムからリターンできる。
【0132】
〔実施の形態2〕
上述の実施の形態1におけるプログラムメモリ9に格納されたモニタプログラム (図9, 図11, 図12) のCHCK_DINTルーチン (図10) は、2つのループで構成されている。この処理は実施の形態1のようにプログラムのループ実行による実現手法の他に、特定アドレスで処理を停止するホールト命令によっても実現可能である。
【0133】
この場合のホールト解除のモードとして、DINT=b'0解除及びDINT=b'1解除の2つのモードが必要である。図10のCHCK_DINTルーチンの最初のループにDINT=b'0解除モードのホールト命令を、2つ目のループにDINT=b'1解除モードのホールト命令を、それぞれ用いることで、実施の形態1と同様の動作が実現できる。そのようなホールト命令による場合のフローチャートを図13に示す。
【0134】
図13において、このCHCK_DINTルーチン (ステップS200) は、2つのホールト命令で構成されており、最初のホールト命令 (ステップS201) がDINT=b'0 解除であり、次のホールト命令 (ステップS202) がDINT=b'1 解除である。CHCK_DINTルーチン (ステップS200) はプログラムメモリ内の固定番地に割り付けられているので、 LSIチップ外部 (ホストコンピュータ) からは、実行中のPC値をRD_PC命令により観測することで、いずれのホールト命令を実行しているかを検知することができる。
【0135】
なお、上述の各実施の形態においては命令レジスタ2,命令デコーダ3,DINTレジスタ4,フラグレジスタ5,転送レジスタ6,プログラムカウンタ7等のビット幅について具体的な数値が挙げられているが、それらに限定されるものではない。また、上記各実施の形態においては、本発明のデバッグ装置がホストコンピュータに接続されている例が示されているが、JTAGアクセス可能な装置であればホストコンピュータに限定されるものではない。
【0136】
【発明の効果】
以上に詳述したように、本発明のデバッグ装置によれば、データの書き込み,読み出しに際して、転送メモリにいずれのレジスタ, メモリ (転送レジスタにプログラムメモリ,内部レジスタ,内部メモリ等) を接続するかをモニタプログラムにより行なうため、専用のハードウェアを必要とせず、且つ転送元, 先の変更, 拡張が容易で柔軟なデバッグ装置が実現可能になるという効果がある。
【0137】
また、データの読み出しに際して、転送メモリへのレジスタ, メモリ (転送レジスタにプログラムメモリ,内部レジスタ,内部メモリ等) からのデータ転送終了検知をプログラムカウンタの値のモニタリングにより実現できるため、専用の複雑なハードウェアを必要としない。
【0138】
また、一旦プログラムの実行が停止した後にプログラムを再実行することが可能になる。
【0139】
また更に、転送レジスタと接続可能な複数の記憶手段(内部レジスタ,内部メモリ)の内の少なくとも一部の内容の外部への出力が可能になる。
【0140】
更に、書き込み,読み出し可能なプログラムメモリ(RAM領域) に外部から任意のプログラムの書き込みが可能であるため、デバッグ対象のレジスタ, メモリ等と転送レジスタとの間の転送プログラムを外部から書き込み,読み出し可能なプログラムメモリ(RAM領域) に書き込むことにより、デバッグ対象を任意に選択することが可能になる。
【図面の簡単な説明】
【図1】 本発明のデバッグ装置の一構成例を示すブロック図である。
【図2】 本発明のデバッグ装置の TAPコントローラの遷移状態を示す状態遷移図である。
【図3】 本発明のデバッグ装置の命令レジスタを構成する各ビットのセルの構成例を示すブロック図である。
【図4】 本発明のデバッグ装置の命令レジスタの動作をまとめた一覧図である。
【図5】 本発明野デバッグ装置により使用される命令の一覧図である。
【図6】 本発明のデバッグ装置のDINTレジスタの構成例を示すブロック図である。
【図7】 本発明のデバッグ装置の転送レジスタを構成する各ビットのセルの構成例を示すブロック図である。
【図8】 本発明のデバッグ装置のプログラムカウンタを構成する各ビットのセルの構成例を示すブロック図である。
【図9】 本発明のデバッグ装置のモニタプログラムのフローチャートである。
【図10】 本発明のデバッグ装置のモニタプログラムの実施の形態1によるCHCK_DINTルーチンのフローチャートである。
【図11】 本発明のデバッグ装置の転送レジスタへの書き込み処理のフローチャートである。
【図12】 本発明のデバッグ装置の転送レジスタからの読み出し処理のフローチャートである。
【図13】 本発明のデバッグ装置のモニタプログラムの実施の形態2によるCHCK_DINTルーチンのフローチャートである。
【図14】 従来のデバッグ装置の一構成例を示すブロック図である。
【符号の説明】
1 TAPコントローラ、2 命令レジスタ、3 命令デコーダ、4 DINTレジスタ、5 フラグレジスタ、6 転送レジスタ、7 プログラムカウンタ、
9 プログラムメモリ、10 内部レジスタ、11 内部メモリ、91 RAM領域。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a debugging device, that is, a debugging device for verifying (debugging) whether or not a program operates on hardware as intended by a programmer, and more particularly to a debugging device compliant with JTAG.
[0002]
[Prior art]
As an example of a conventional debugging device, a debugging device using a test access port (TAP) controller that conforms to the test architecture and test interface defined by IEEE Standard 1149.1 by JTAG (Joint Test Action Group) is known. ing. "JTAG" is originally an organization for standardization of testability design methods, but today, the test interface specifications standardized by this organization are also commonly called JTAG.
[0003]
FIG. 14 is a block diagram showing the configuration of a test & debug device built in a Motorola DSP161X series LSI chip as an example of a debug device using such a technology.
[0004]
In FIG. 14, reference numeral 1 denotes a test access port (TAP) controller (hereinafter referred to as a TAP controller) compliant with a test architecture and test interface defined by JTAG as IEEE standard 1149.1. This TAP controller 1 is predetermined according to a TCK (Test ClocK) signal given to the input terminal 54 from the outside, a TMS (Test Mode Select) signal given to the input terminal 55, and a TRST (Test ReSeT) signal given to the input terminal 53. State transition is performed (refer to FIG. 2 for details). A control signal generated in accordance with the state transition of the TAP controller 1 and a signal resulting from decoding of an instruction code by an instruction decoder 3 described later is sent to an instruction register 2, a flag register 5, a transfer register 6, a control register 16, and a multiplexer 8 described later. Is given.
[0005]
The instruction register 2 is connected between an input terminal 51 for a TDI (Test Data Input) signal, which is an N-bit serial input, and an output terminal 52 for a TDO (Test Data Output) signal, which is an N-bit serial output. Are located on an N-bit scan path accessible by a protocol defined by JTAG. In the following description, accessing by a protocol defined by JTAG is referred to as JTAG access. The instruction register 2 stores the test instruction input from the outside as a TDI signal via this scan path. In addition to the instruction register 2, a flag register 5, a transfer register 6, and a control register 16 are located on the scan path formed between the TDI signal input terminal 51 and the TDO signal input terminal 52. .
[0006]
The instruction decoder 3 decodes the contents of the instruction register 2, that is, the instruction code stored in the instruction register 2, and gives a signal obtained as a result to the TAP controller 1. The instruction decoded by the instruction decoder 3 supports private instructions necessary for testing and debugging in addition to three kinds of essential instructions defined in IEEE standard 1149.1 (1990).
[0007]
The flag register 5 is accessible through the above-described N-bit scan path accessible by JTAG, and stores the internal state of the chip. The flag register 5 has a plurality of bits and includes, for example, an interrupt flag such as JINT (JTAG interrupt) and PINT (JTAG interrupt status), a flag of carry of an operation result, an overflow, and the like.
[0008]
The transfer register 6 can be accessed through the above-described N-bit scan path that can be accessed by JTAG. By performing JTAG access from the outside, it is possible to access internal registers and memories. Specifically, the transfer register 6 can transfer data to and from a program memory 9, an internal register 10 and an internal memory 11 to be described later, and its control is controlled by a control register 16 to be described later.
[0009]
The multiplexer 8 selects one of the N-bit scan path outputs, that is, one of the outputs of the instruction register 2, the flag register 5, the transfer register 6, and the control register 16 under the control of the TAP controller 1, and TDO Serial output as a signal.
[0010]
The program memory 9 can transfer data to and from the transfer register 6 as described above, and stores a program to be executed by this chip.
[0011]
The internal register 10 is one or a plurality of registers normally provided in the chip, and data can be transferred to and from the transfer register 6 as described above. The internal memory 11 is one or a plurality of memories usually provided in the chip, and can transfer data to and from the transfer register 6 as described above.
[0012]
The control register 16 controls connection between the transfer register 6 and any one of the program memory 9, the internal register 10, and the internal memory 11. Under the control of the control register 16, data is transferred from the transfer register 6 to the program memory 9, the internal register 10 or the internal memory 11, and data is transferred from the program memory 9, the internal register 10 or the internal memory 11 to the transfer register 6. The
[0013]
Reference numeral 17 indicates an interrupt control unit. The interrupt control unit 17 manages interrupt control for synchronizing the transfer between the transfer register 6 and the program memory 9, the internal register 10, and the internal memory 11 by the control register 16 described above. Specifically, the interrupt control unit 17 stops the operation of the chip based on the JINT signal given from the flag register 5 and transfers the contents of the transfer register 6 to any one of the program memory 9, the internal register 10, and the internal memory 11. Conversely, the contents of any one of the program memory 9, the internal register 10, and the internal memory 11 are transferred to the transfer register 6, and then the PINT signal is set.
[0014]
The operation of the conventional debugging apparatus as described above is as follows. First, the operation at the time of writing data from the outside to the inside of the chip will be described.
[0015]
The write instruction is set in the instruction register 2 and the control register 16 is set by the JTAG access from the outside of the chip as to whether the write destination is the program memory 9, the internal register 10, or the internal memory 11. Data to be written is set in the transfer register 6 from outside the chip by JTAG access, and after the setting is completed, the JINT flag of the flag register 5 is set from outside the chip by JTAG access. When the JINT flag is set, the interrupt control unit 17 stops the operation of the chip, and the contents of the transfer register 6 are transferred to the transfer destination set in the control register 16, that is, the program memory 9, the internal register 10, and the internal memory 11 Transfer to one of the following. Thus, the write operation is completed.
[0016]
Next, the operation at the time of reading data from the inside of the chip to the outside will be described.
[0017]
The read instruction is set in the instruction register 2 and the control register 16 is set as to whether the read source is the program memory 9, the internal register 10, or the internal memory 11 from the outside of the chip using JTAG access. The JINT flag of the flag register 5 is set by JTAG access from outside the chip. When the JINT flag is set, the interrupt control unit 17 stops the operation of the chip and transfers the contents of the data transfer source set in the control register 16 to the transfer register 6. When this data transfer ends, the interrupt control unit 17 sets the PINT flag. Next, after confirming the setting of the PINT flag by monitoring the contents of the flag register 5 using JTAG access from the outside, the contents of the transfer register 6 are read out of the chip using JTAG access. Thus, the read operation is completed.
[0018]
[Problems to be solved by the invention]
By the way, the following two problems can be considered as problems in the conventional debugging apparatus as described above. First, when writing or reading data, hardware (control register 16) is used to set which of the program memory 9, the internal register 10, and the internal memory 11 is connected to the transfer register 6; Has been increasing. Furthermore, since it is necessary to increase the bit width of the hardware (control register 16) in accordance with the combination of connections described above, the hardware resources are further increased.
[0019]
Second, when reading data, dedicated hardware (interrupt control unit 17) is required to detect the end of data transfer from the register / memory to the transfer register 6, and as a result, hardware resources increase as described above. Moreover, the control is complicated.
[0020]
The present invention has been made in view of such circumstances, and suppresses an increase in hardware resources necessary for testing and debugging, and allows flexible setting by setting the data write destination and read source by software. The purpose is to provide a debugging device that enables the above.
[0021]
[Means for Solving the Problems]
A debugging device according to the present invention basically includes a control circuit that operates in response to an external input signal, an instruction register capable of inputting a predetermined instruction from the outside by an access controlled by the control circuit, and an instruction register An instruction decoder that decodes the contents of the program, an output controlled by the control circuit that can output the contents to the outside, a program counter that generates a program address to be executed, and an access according to the value of the program counter And a program memory. The program memory stores a program including a pause process that does not execute an address after a predetermined address after the end of a specific process. When a predetermined instruction is decoded by the instruction decoder, the control circuit accesses the program counter and outputs the value to the outside, so that the end of the specific process is completed when the address of the pause processing is output. Detected.
[0022]
Further, in the debugging device according to the present invention, in order to realize the basic configuration described above, the temporary pause process stored in the program memory is a program that loops between predetermined addresses after the end of the specific process, Alternatively, it is a program that waits for execution of a program at a specific address after completion of a specific process. Therefore, since the address of a program that loops between predetermined addresses or a program that waits for execution of the program is output to the outside after the specific process is completed, the end of the specific process is detected.
[0023]
The debugging device according to the present invention includes a first register (DINT register) capable of holding a value of a signal input from the outside by an access controlled by the control circuit, and a first register (DINT register). A second register (flag register) that holds the held signal value in synchronization with a signal input from the outside at an arbitrary timing and releases the pause processing according to this value is provided. Thereby, the execution of the program is temporarily stopped after the specific process is completed, but the program can be re-executed thereafter.
[0024]
Furthermore, the debugging device according to the present invention can output the contents to the outside by access controlled by the control circuit, and has a transfer register connectable to a plurality of storage means (internal registers, internal memories). The program memory stores a transfer program between at least a part of a plurality of storage means (internal registers, internal memory) connectable to the transfer register and the transfer register. When a predetermined instruction is decoded by the instruction decoder, the control circuit accesses the transfer register and outputs the value to the outside, whereby a plurality of storage means (internal register, internal memory) connectable to the transfer register It is possible to output at least part of the contents to the outside.
[0025]
Furthermore, the debugging device according to the present invention is characterized in that a part of the program memory is connected to a transfer register, and has an area that can be accessed by a value of the program counter and can be written and read. Therefore, by accessing the transfer register under the control of the control circuit, an arbitrary program can be written from the outside to a writable / readable program memory (RAM area). Specifically, it is possible to arbitrarily select the debug target by writing the transfer program between the register, memory, etc. to be debugged and the transfer register from the outside and writing to the readable program memory (RAM area). become.
[0026]
DETAILED DESCRIPTION OF THE INVENTION
[Embodiment 1]
Hereinafter, the present invention will be described in detail with reference to the drawings illustrating embodiments thereof. FIG. 1 is a block diagram showing an example of the configuration of a debugging device according to the present invention, and shows the minimum components necessary for realizing the debugging device of the present invention when integrated as an LSI chip.
[0027]
In FIG. 1, reference numeral 1 indicates a test access port (TAP) controller (hereinafter referred to as a TAP controller) compliant with the test architecture and test interface defined by IEEE standard 1149.1 by JTAG. This TAP controller 1 Is It functions as a control circuit and is described later according to the TCK (Test Clock) signal given to the input terminal 54 from the outside, the TMS (Test Mode Select) signal given to the input terminal 55, and the TRST (Test ReSet) signal given to the input terminal 53. State transition as shown in the state transition diagram of FIG. A control signal generated in accordance with the transition state by the TAP controller 1 and a signal of the decoding result of the instruction code by the instruction decoder 3 which will be described later is an instruction register 2, a DINT register 4, a transfer register 6, a program counter 7 and a multiplexer 8 which will be described later. Is given to.
[0028]
The instruction register 2 is connected between an input terminal 51 for a TDI (Test Data Input) signal, which is an N-bit serial input, and an output terminal 52 for a TDO (Test Data Output) signal, which is an N-bit serial output. Are located on an N-bit scan path accessible by a protocol defined by JTAG. In the following description, accessing by a protocol defined by JTAG is referred to as JTAG access. Then, the instruction register 2 stores the test instruction input from the outside as a TDI signal via this scan path. In addition to the instruction register 2, a DINT register 4, a transfer register 6, and a program counter 7 are located on the scan path formed between the TDI signal input terminal 51 and the TDO signal output terminal 52. .
[0029]
The instruction decoder 3 decodes the contents of the instruction register 2, that is, the instruction code stored in the instruction register 2, and gives a signal obtained as a result to the TAP controller 1. The instructions decoded by the instruction decoder 3 include private instructions necessary for testing and debugging in addition to the three types of essential instructions defined in IEEE Standard 1149.1 (1990).
[0030]
The DINT register 4 functions as the first register and can be accessed through an N-bit scan path that allows JTAG access. By inputting JTAG access from the outside, a debugger interrupt (DINT) signal, which is a PC break signal, is input. Hold. The DINT signal held in the DINT register 4 is applied to a 2-input OR gate 14 which will be described later.
[0031]
Reference numeral 5 indicates a flag register that functions as a second register for storing the internal state of the chip. The flag register 5 is supplied with the logical sum output signal of the logical sum gate 14 described above. A pin input signal DINT input to the input terminal 56 from the outside of the chip and an output signal of the DINT register 4 are input to the OR gate 14. The flag register 5 is connected to the transfer register 6 and the program counter 7 via the local bus 13.
[0032]
The transfer register 6 can be accessed through the above-described N-bit scan path accessible by JTAG. In other words, by performing JTAG access to the transfer register 6 from the outside, it is possible to access internal registers and memories via the transfer register 6. Specifically, the transfer register 6 is connected to a program memory 9, an internal register 10 and an internal memory 11, which will be described later, via an internal bus 12, and the flag register 5 and the program counter 7 are connected to the local bus 13. Are connected to each other. The internal bus 12 is also connected to the input / output port 15.
[0033]
The program counter 7 is accessible through an N-bit scan path accessible by JTAG, and generates and holds an address of an instruction code to be read from the program memory 9.
[0034]
The multiplexer 8 selects one of the N-bit scan path outputs, that is, one of the outputs of the instruction register 2, the DINT register 4, the transfer register 6 and the program counter 7 under the control of the TAP controller 1, and TDO Serial output as a signal.
[0035]
As described above, the program memory 9 can transfer data to and from the transfer register 6 via the internal bus 12, and stores a program to be executed by this chip. The program memory 9 is essentially a ROM, but a RAM area 91 is provided as a writable and readable area.
[0036]
The internal register 10 is one or a plurality of registers normally provided in the chip, and can transfer data to and from the transfer register 6 via the internal bus 12 as described above. The internal memory 11 is one or a plurality of memories normally provided in a chip, and can transfer data to and from the transfer register 6 via the internal bus 12 as described above.
[0037]
Next, input signals and output signals of the components of the debugging device of the present invention will be described.
[0038]
The TCK (Test ClocK) signal is an input signal to the TAP controller 1 and is a clock signal for the test access port. The TMS (Test Mode Select) signal is an input signal to the TAP controller 1 and controls the state transition of the TAP controller 1. The TDI (Test Data Input) signal is a test data register (DINT register 4, transfer register 6, program counter 7, etc., hereinafter referred to as test data registers 4, 6, 7, etc.) having an instruction register 2 and a JTAG accessible scan path. ) Is a serial input signal to.
[0039]
A TDO (Test Data Output) signal is a serial output signal from the instruction register 2 and the test data registers 4, 6, 7, etc. having a scan path accessible by JTAG. The TRST (Test ReSeT) signal is an input signal to the TAP controller 1 and a reset input signal of the TAP controller 1. The pin input DINT signal is an input signal to the OR gate 14 and is a debugger interrupt input signal. The PC break DINT signal is an input signal to the DINT register 4, and is a signal that becomes “1” when a break condition is established by a break point set in the program memory 9.
[0040]
Note that these input / output signals to the TAP controller 1 are actually input from a host computer (not shown) and output to the host computer.
[0041]
Next, each component of the debugging device of the present invention shown in FIG. 1 will be described more specifically.
[0042]
The TAP controller 1 performs state transition according to the value of the TMS signal at all rising edges of the clock of the TCK signal, and takes one of the 16 states shown in FIG. Circuits such as the instruction register 2 and the test data registers 4, 6, and 7 operate on both the rising and falling edges of the clock of the TCK signal. Hereinafter, each state of the state transition by the TAP controller 1 will be specifically described below.
[0043]
* Test-Logic-Reset state
Reset state. In this state, the normal operation of the chip is not hindered. When the TAP controller 1 transitions to this state, the BYPASS instruction (b'11111) is forcibly loaded into the output latch (see FIG. 3) of the instruction register 2. The detailed configuration of the instruction register 2, DINT register 4, transfer register 6, and program counter 7 will be described later. “B ′” indicates binary display, and in this embodiment, the instruction code is 5 bits. Regardless of the initial state, the TAP controller 1 transitions to this Test-Logic-Reset state when the TRST signal is asserted or the TMS signal is maintained at b'1 for more than 5 clock periods of the TCK signal. After that, this Test-Logic-Reset state is maintained as long as the TMS signal maintains b'1. However, if the b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Run-Test / Idle state.
[0044]
* Run-Test / Idle state
Test instruction execution state. In this state, the scan operation is not performed, and the specified operation is executed according to the instruction held in the instruction register 2. In this state, the instruction does not change. The TAP controller 1 maintains this state as long as the TMS signal maintains b'0. When the b'1 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Select-DR-Scan state. “DR” represents the test data registers 4, 6, 7, and the like.
[0045]
* Select-DR-Scan status
Temporary state for transitioning to another state. The test data registers 4, 6, 7, etc. hold the values so far. In this state, the instruction does not change. In this state, when the b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transits to the Captur-DR state, and scans the test data registers 4, 6, 7, etc. designated by the instruction. Operation starts. When the b'1 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Select-IR-Scan state. “IR” represents the instruction register 2.
[0046]
* Select-IR-Scan status
Temporary state for transitioning to another state. The test data registers 4, 6, 7, etc. hold the values so far. In this state, the instruction does not change. In this state, when the b'0 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transits to the Captur-IR state, and the scan operation of the instruction register 2 is started. When the b'1 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Test-Logic-Reset state described above.
[0047]
* Captur-DR state
A state in which values are taken into the shift register stages such as test data registers 4, 6, and 7 from the outside. At the rising edge of the clock of the TCK signal, data is loaded from the parallel input port to any one of the test data registers 4, 6, 7, etc. designated by the current instruction. If the designated test data register 4, 6, 7, etc. does not have a parallel input port, or if parallel input is not instructed by an instruction, the test data register 4, 6, 7 etc. will retain the previous values To do. In this state, the instruction does not change. In this state, when the b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Shift-DR state, and at the rising edge of the TCK signal clock, the b'1 TMS signal is output. When input, TAP controller 1 transitions to the Exit1-DR state.
[0048]
* Shift-DR state
A state in which the test data registers 4, 6, 7, etc. are scanned. One of the test data registers 4, 6, 7, etc. specified by the current instruction is connected to the scan path formed between the input terminal 51 of the TDI signal and the output terminal 52 of the TDO signal, and the clock of the TCK signal Data is shifted by one bit in the serial output direction at every rising edge. In this state, the instruction does not change. The TAP controller 1 maintains this state as long as the TMS signal maintains b'0. When the TMS signal b'1 is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Exit1-DR state.
[0049]
* Exit1-DR state
Temporary state for transitioning to another state. The test data registers 4, 6, 7, etc. hold the values so far. In this state, the instruction does not change. In this state, when the b'1 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transits to the Update-DR state and ends the scanning process. When the b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Pause-DR state.
[0050]
* Pause-DR state
A state in which the shift operation of the test data registers 4, 6, 7, etc. is temporarily stopped. The test data registers 4, 6, 7, etc. hold the values so far. In this state, the instruction does not change. The TAP controller 1 maintains this state as long as the TMS signal maintains b'0. When the TMS signal of b'1 is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Exit2-DR state.
[0051]
* Exit2-DR status
Temporary state for transitioning to another state. The test data registers 4, 6, 7, etc. hold the values so far. In this state, the instruction does not change. In this state, when the b'1 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 ends the scan process and transitions to the Update-DR state. When the b'0 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transitions to the aforementioned Shift-DR state.
[0052]
* Update-DR status
A state in which output latches of test data registers 4, 6, 7, etc. are updated. Data is transferred from the shift registers such as the test data registers 4, 6, and 7 to the parallel output latch at the falling edge of the clock of the TCK signal, but the shift register holds the previous value. The parallel output latches of the test data registers 4, 6, 7, etc. are provided to prevent the parallel output values from changing while the test data registers 4, 6, 7, etc. are performing the scanning operation. In this state, the instruction does not change. In this state, when the b'1 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 shifts to the above-described Select-DR-Scan state, and at the rising edge of the clock of the TCK signal, b'0 When the TMS signal is input, the TAP controller 1 transits to the above-mentioned Run-Test / Idle state.
[0053]
* Captur-IR state
A state in which a fixed value is taken into the shift register stage of the instruction register 2. In the present embodiment, a fixed value b′00001 is loaded from the parallel input port of the instruction register 2 at the rising edge of the clock of the TCK signal. In this state, the test data registers 4, 6, 7, etc. hold the values so far and the instruction does not change. In this state, when a b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Shift-IR state, and at the rising edge of the TCK signal clock, the b'1 TMS signal is output. When input, TAP controller 1 transitions to the Exit1-IR state.
[0054]
* Shift-IR state
A state in which the instruction register 2 is scanned. The instruction register 2 is connected to a scan path formed between the TDI signal input terminal 51 and the TDO signal output terminal 52, and the data is shifted in the serial output direction bit by bit at every rising edge of the clock of the TCK signal. The In this state, the test data registers 4, 6, 7, etc. hold the values so far, and the instruction does not change. The TAP controller 1 maintains this state as long as the TMS signal maintains b'0. When the b'1 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transits to the Exit1-IR state.
[0055]
* Exit1-IR status
Temporary state for transitioning to another state. The instruction register 2 holds the previous value. In this state, the test data registers 4, 6, 7, etc. hold the values so far, and the instruction does not change. In this state, when the b'1 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transits to the Update-IR state and ends the scanning process. When the b'0 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transitions to the Pause-IR state.
[0056]
* Pause-IR state
A state in which the shift operation of the instruction register 2 is temporarily stopped. The instruction register 2 holds the previous value. In this state, the test data registers 4, 6, 7, etc. hold the values so far, and the instruction does not change. The TAP controller 1 maintains this state as long as the TMS signal maintains b'0. When the b'1 TMS signal is input at the rising edge of the TCK signal clock, the TAP controller 1 transits to the Exit2-IR state.
[0057]
* Exit2-IR status
Temporary state for transitioning to another state. The instruction register 2 holds the previous value. In this state, the test data registers 4, 6, 7, etc. hold the values so far, and the instruction does not change. In this state, when the b'1 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 ends the scan process and transitions to the Update-IR state. When the b'0 TMS signal is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transitions to the aforementioned Shift-IR state.
[0058]
* Update-IR status
A state in which the output latch of the instruction register 2 is updated. Data is transferred from the shift register of the instruction register 2 to the parallel output latch at the falling edge of the clock of the TCK signal. When a new instruction is latched into the output latch of instruction register 2, it becomes the current instruction. In this state, the test data registers 4, 6, 7, etc. hold the values so far. In this state, when the TMS signal b′1 is input at the rising edge of the clock of the TCK signal, the TAP controller 1 transitions to the above-described Select-DR-Scan state, and b′0 at the rising edge of the clock of the TCK signal. When the TMS signal is input, the TAP controller 1 transitions to the Run-Test / Idle state described above.
[0059]
The TAP controller 1 takes one of the above 16 states, but the Puase-DR state and the Puase-IR of these Status Is necessary to temporarily stop the operation while shifting data into the instruction register 2 or the test data registers 4, 6, 7, etc., for example, an automatic test equipment is installed in the memory from the disk. This is necessary when loading long test sequences.
[0060]
The TAP controller 1 performs three basic operations for testing. The three types of operations are signal input (Update-DR), execution (Run-Test / Idle), and result capture (Captur-DR). However, all of these test operations are not necessarily required in all tests.
[0061]
The driver for the TDO signal output in the multiplexer 8 drives b'1 or b'0 only when the TAP controller 1 is in the Shift-IR state or Shift-DR state, and is high when it is in the other state. It becomes an impedance state.
[0062]
Next, the configuration of the instruction register 2 will be described with reference to the block diagram of FIG. In this embodiment, the instruction register 2 as a whole is configured as a 5-bit wide register by connecting each 1-bit cell to the lower bit side serial output to the upper bit side serial input. In general, it has a two-stage configuration of a shift register stage having a parallel input, a serial input and a serial output, and an output latch having a parallel output and holding an instruction currently being executed.
[0063]
The internal structure of each cell constituting the instruction register 2 is the same, and is indicated by reference numeral 200 in the block diagram of FIG. Specifically, the shift register stage of each cell 200 of the instruction register 2 is composed of a multiplexer 231 and a flip-flop 232, and the output latch is composed of a flip-flop 233. The multiplexer 231 constituting the shift register stage has a parallel input and a serial input. The Shift / # Captur signal, that is, the Shift signal output from the TAP controller 1 in the Shift-DR state or the Shift-IR state, and the TAP controller 1 is Captur. -Either one is output to the flip-flop 232 in response to the #Captur signal which is an inverted signal of the signal output in the DR state or Captur-IR state. The flip-flop 232 latches the output signal of the multiplexer 231 using the TCK signal as a trigger signal, and outputs it as a serial output to the next cell or TDO signal to the outside. The flip-flop 233 latches the output of the flip-flop 232 using the Update-IR signal as a trigger signal, and outputs it in parallel to the instruction decoder 3.
[0064]
Therefore, the operation in which the TDI signal is input to the multiplexer 231 of the first stage cell 200 of the instruction register 2 and the output signal from the flip-flop 232 is input to the multiplexer 231 of the next stage cell 200 is repeated. An output signal from the flip-flop 232 of the cell 200 at the final stage is output to the multiplexer 8 as a TDO signal. The output from the flip-flop 233 of each cell 200 is input to the instruction decoder 3 as a 5-bit parallel output.
[0065]
In the instruction register 2 having such a configuration, the serial input to the first stage cell 200 and the serial output from the last stage cell 200 are the TDI signal input terminal 51 and the TDO signal output terminal 52 (multiplexer 8) in FIG. A 5-bit serial scan path is formed. In such a scan path, each cell 200 sequentially transfers data in synchronization with the rising edge of the clock of the TCK signal after the TAP controller 1 transitions to the Shift-IR state. Each bit of the fixed value b′00001 is loaded from the parallel input to the multiplexer 231 of each cell 200 in synchronization with the rising edge of the clock of the TCK signal after the TAP controller 1 transitions to the Captur-IR state. In this fixed value, b′1 is LSB and is loaded into the cell 200 at the final stage. The bit of the instruction code held in the flip-flop 232 of the shift register stage of each cell 200 is a flip-flop that constitutes an output latch in synchronization with the falling edge of the clock of the TCK signal when the TAP controller 1 is in the Update-IR state. Forwarded to 233. The parallel output latch of each cell 200 is reset when the TAP controller 1 transitions to the Test-Logic-Reset state, and b'11111 (BYPASS instruction) is set in synchronization with the falling edge of the TCK signal clock. When TRST signal is asserted, b'11111 (BYPASS command) is set asynchronously with the clock of TCK signal.
[0066]
The operation of the instruction register 2 in each state of the TAP controller 1 as described above is summarized in the list of FIG.
[0067]
The instruction decoded by the instruction decoder 3 supports four private instructions in addition to the three essential instructions defined in IEEE standard 1149.1 (1990). All test instructions have a 5-bit code, and the bit pattern of each instruction and the scan register to be used are shown in the list of FIG. In FIG. 5, the instruction code is displayed in hexadecimal. In the following explanation, 16 Progress The display is indicated by h ′.
[0068]
Of the instructions shown in Fig. 5, the BYPASS instruction (instruction code h'1F), SAMPLE / PRELOAD instruction (instruction code h'02) and EXTEST instruction (instruction code h'00) are essential instructions. Since they are not directly related to the invention, their details are omitted. The BYPASS instruction is an essential standard instruction for operating the bypass register, and the SAMPLE / PRELOAD instruction and the EXTEST instruction are essential standard instructions for operating the boundary scan register, and are called boundary scan register instructions.
[0069]
The instructions unique to the present invention are the SETDINT instruction (instruction code h'16), the RD_PC instruction (instruction code h'0C), the RD_Trans instruction (instruction code h'0E), and the WR_Trans instruction (instruction code h'0F). The SETDINT instruction (instruction code h'16) is an instruction for communication between the debugger and the monitor program during program debugging. The RD_PC instruction (instruction code h′0C) is an instruction for sampling the output of the latch of the program counter 7. The RD_Trans instruction (instruction code h'0E) and the WR_Trans instruction (instruction code h'0F) are instructions for sampling and writing to the transfer register 6, respectively. Details of how to use the above four private instructions will be described when explaining the operation of the debugging device of the present invention.
[0070]
FIG. 6 is a block diagram showing a configuration example of the DINT register 4. The DINT register 4 is a 1-bit register, inputs the TDI signal and DINT signal shown in FIG. 1 and outputs one of them according to the Shift / # Captur signal, and the output signal of the multiplexer 431 uses the TCK signal as a trigger signal. The flip-flop 432 that latches the output signal, the flip-flop 433 that latches the output signal of the flip-flop 432 using the output signal of the AND gate 436 as a trigger signal, the output signal of the flip-flop 433 and the DINT signal are input, and the SETDINT signal The multiplexer 434 that outputs one of them and the above-described AND gate 436 that receives the SETDINT signal and the Update-DR signal are included.
[0071]
The serial input to the multiplexer 431 is the TDI signal shown in FIG. 1. When this signal is once latched in the flip-flop 432 and serially output to the multiplexer 8 as an output signal, a 1-bit scan path is formed. In this scan path, the flip-flop 432 captures the data from the serial input to the multiplexer 431 and transfers the data to the serial output in synchronization with the rising edge of the TCK signal clock after the TAP controller 1 transitions to the Shift-DR state. To do. On the other hand, from the DINT input, the PC break DINT signal in FIG. 1 is fetched by the flip-flop 432 in synchronization with the rising edge of the TCK signal clock after the TAP controller 1 transitions to the Captur-DR state, and the data is transferred to the serial output. To do. Further, the flip-flop 433, the multiplexer 434, and the AND gate 436 allow the value of the flip-flop 432 to be synchronized with the falling edge of the clock of the TCK signal when the TAP controller 1 is in the Update-DR state by the SETDINT instruction. 433 and output from the DINT output of the multiplexer 434 to the OR gate 14 of FIG. In the case other than the SETDINT instruction, the value of the PC break DINT in FIG. 1 is output to the DINT output.
[0072]
The flag register 5 is a multi-bit register for storing various states inside the LSI chip, similar to that of a general computer. These various states include flags such as carry and overflow of operation results, and a bit width corresponding to the number of necessary states such as DINT (debugger interrupt) related to this embodiment is required. It is. In the present embodiment, only one bit of DINT is related. The DINT bit is also connected to the local bus 13 and can be accessed via the local bus 13 in addition to the access by the DINT register 4.
[0073]
FIG. 7 is a block diagram showing a configuration example of a cell for one bit of the transfer register 6. Since the transfer register 6 can be accessed by JTAG and is connected to the local bus 13 and the internal bus 12, the transfer register 6 is connected to the local bus 13 and the internal bus 12 by performing JTAG access to the transfer register 6 from the outside of the chip. All registers and memories inside the chip can be accessed from outside the chip.
[0074]
Each bit 600 of the transfer register 6 includes a data latch 630 that holds parallel data, a shift register stage (flip-flop 632) that holds serial data, and an output latch (flip-flop) that transfers serial data to the data latch 630. 633) latches, multiplexers 631, 634, 635 and an AND gate 636.
[0075]
The multiplexer 635 receives the parallel input and the output of the multiplexer 634, and outputs either to the data latch 630 according to the WR_Trans signal output from the TAP controller 1 in response to the WR_Trans command. The multiplexer 631 receives the held value of the data latch 630 and the serial input, and outputs either one according to the Shift / # Captur signal. The flip-flop 632 latches the output of the multiplexer 631 using the TCK signal as a trigger and outputs it as a serial output. The flip-flop 633 latches and outputs the serial output of the flip-flop 632 using the output signal of the AND gate 636 as a trigger. The multiplexer 634 receives the output signal of the flip-flop 633 and the hold value of the data latch 630, and outputs either one to the multiplexer 635 according to the WR_Trans signal output from the TAP controller 1 in response to the WR_Trans command. The AND gate 636 receives the WR_Trans signal and the Update-DR signal output from the TAP controller 1 in the Update-DR state.
[0076]
The transfer register 6 of the present embodiment is a 16-bit register having each bit of the cell 600 shown in FIG. Each cell 600 is configured to have a 16-bit width by connecting the serial output of the flip-flop 632 on the lower bit side to the serial input of the multiplexer 631 on the upper bit side. As shown in FIG. A 16-bit scan path is formed between the signal input terminal 51 and the TDO signal output terminal 62 (multiplexer 8).
[0077]
In this scan path, the multiplexer 631 and the flip-flop 632 synchronize with the rising edge of the clock of the TCK signal after the TAP controller 1 transitions to the Shift-DR state, from the serial input of the multiplexer 631 to the serial output of the flip-flop 632. Simultaneously with the data transfer, the output data of the flip-flop 632 is taken into the flip-flop 632. From the parallel output that is the output of the data latch 630, the held value of the data latch 630 is flip-flops via the multiplexer 631 in synchronization with the rising edge of the clock of the TCK signal after the TAP controller 1 transitions to the Captur-DR state. 632 is loaded. The value held in flip-flop 632 by flip-flop 633, multiplexer 634, AND gate 636, and multiplexer 635 is synchronized with the falling edge of the TCK signal clock when TAP controller 1 is in the Update-DR state with the WR_Trans instruction. Then, the data is taken into the flip-flop 633 and inputted to the data latch 630 via the multiplexers 634 and 635. In the case other than the WR_Trans instruction, the parallel input as the TDI signal is input to the data latch 630 via the multiplexer 635.
[0078]
FIG. 8 is a block diagram showing a configuration example of a cell for one bit of the program counter 7. The program counter 7 has functions such as increment, jump, loop, etc., in the same way as that of a general computer, and accesses the program memory 9 using this count value (PC value) as an access address. As a result, the instruction code is output. However, in the present invention, the original function of the program counter 7 is not important, and it is important that the value of the program counter 7 is JTAG accessible and can be monitored from the outside of the chip.
[0079]
The program counter 7 of the present embodiment is a 16-bit register having each bit of the cell 700 shown in FIG. Each cell 700 of the program counter 7 includes a data latch 730 that holds parallel data after processing such as increment, jump, and loop, latches of a shift register stage (flip-flop 732) that holds serial data, and a multiplexer 731. It is configured.
[0080]
The parallel input is input to the data latch 730, the held value of the data latch 730 and the serial input are input to the multiplexer 731, and the # Shift / Captur signal, that is, the TAP controller 1 is in the Shift-DR state or the Shift-IR state. Either the #Shift signal, which is an inverted signal of the output signal, and the Captur signal output by the TAP controller 1 in the Captur-DR state or Captur-IR state are output to the flip-flop 232. The flip-flop 732 latches the output signal of the multiplexer 731 using the TCK signal as a trigger and outputs it as a serial output.
[0081]
Each cell 700 is configured to have a 16-bit width by connecting the serial output of the flip-flop 732 on the lower bit side to the serial input of the multiplexer 731 on the upper bit side, as shown in FIG. A 16-bit scan path is formed between the TDI signal input terminal 51 and the TDO signal output terminal 52 (multiplexer 8).
[0082]
In this scan path, the multiplexer 731 and the flip-flop 732 cause the serial input of the multiplexer 731 to the serial output of the flip-flop 732 in synchronization with the rising edge of the clock of the TCK signal after the TAP controller 1 transitions to the Shift-DR state. At the same time as the data is transferred, the flip-flop 732 captures the data. From the parallel output that is the output of the data latch 730, the value of the data latch 730 is loaded into the flip-flop 732 in synchronization with the rising edge of the clock of the TCK signal after transition to the Captur-DR state.
[0083]
The multiplexer 8 drives a high-level or low-level signal, that is, a b′1 or b′0 signal only when the TAP controller 1 is in the Shift-IR state and the Shift-DR state. The multiplexer 8 selects the serial output at the final stage of the instruction register 2 and outputs it as the TDO signal when the TAP controller 1 is in the Shift-IR state. The multiplexer 8 selects the serial output of the DINT register 4 when the TAP controller 1 is in the Shift-DR state and the SETDINT instruction is executed, and the program counter 7 when the RD_PC instruction is executed. When the RD_Trans instruction and the WR_Trans instruction are executed, the serial output of the final stage of the transfer register 6 is selected and each is output as a TDO signal. When the TAP controller 1 is in any other state, the multiplexer 8 is in a high impedance state.
[0084]
The program memory 9 is a memory for storing the instruction code of a program necessary for the computer to execute processing, similar to that of a general computer with respect to its function, and the instruction code according to the address value indicated by the program counter 7 Is stored. However, in the debugging device of the present invention, the monitor program shown in the flowchart of FIG. 9 needs to be stored at a specific location in the program memory 9.
[0085]
The monitor program shown in FIG. 9 is executed when b′1 is set in the DINT bit of the flag register 5, in other words, when a DINT interrupt occurs. This can be easily realized by jumping the PC value of the program counter 7 to the head address of the monitor program when b'1 is set in the DINT bit of the flag register 5. However, it is also necessary to store the address before the jump in some storage means so that the address can be returned to that address upon return after execution of the monitor program, so-called context loading / restoration. Further, it is necessary to devise a mechanism so that the flag register 5 or the program counter 7 does not accept multiple DINT interrupts during the period from the start of execution of the monitor program due to the occurrence of the DINT interrupt until the return.
[0086]
The internal register 10 is a plurality of registers connected to the transfer register 6 via the internal bus 12. Data can be transferred to and from the transfer register 6 by a program.
[0087]
The internal memory 11 is a plurality of memories connected to the transfer register 6 via the internal bus 12. Data can be transferred to and from the transfer register 6 by a program.
[0088]
The internal bus 12 connects the transfer register 6 to the program memory 9, the internal register 10 and the internal memory 11. The local bus 13 connects the transfer register 6 to the flag register 5 and the program counter 7.
[0089]
The OR gate 14 is a logic gate that performs an OR operation on the pin input DINT signal set from the outside of the chip and the output signal of the DINT register 3, and the result is given to the flag register 5.
[0090]
The input / output port 15 is connected to the internal bus 12 and can be connected to a memory or the like outside the LSI chip of the debugging device of the present invention shown in FIG. Data can be transferred between the transfer register 6 and a memory outside the LSI chip by the program through the input / output port 15.
[0091]
The operation of the debugging device of the present invention configured as described above will be described below. In this embodiment, an LSI chip having the above-described configuration as a minimum and a host computer connected to the LSI chip by four (5) signal lines of TDI, TDO, TCK, TMS, (TRST) In the following description of the operation, it is assumed that the host computer is connected to the debugging device of the present invention shown in FIG. For the host computer, if the TDI, TDO, TCK, TMS, (TRST) signal protocol conforms to the IEEE1149.1 standard defined by JTAG, in other words, if JTAG access is possible. It is not limited.
[0092]
First, how the instruction is set from the host computer in the debugging apparatus of the present invention shown in FIG. 1 and how it is executed will be described with respect to the above-described four private instructions. The instruction setting procedure is the same for any instruction. In the state transition diagram of FIG. 2 described above, the host computer inputs the TMS signal to the TAP controller 1 while changing its value so that the TAP controller 1 performs the following state transition. The value of the TMS signal input from the host computer to the TAP controller 1 is sampled by the TAP controller 1 in synchronization with the rising edge of the TCK signal clock.
[0093]
Test-Logic-Reset → Run-Test / Idle → Select-DR-Scan → Select-IR-Scan → Captur-IR → Shift-IR →… → Shift-IR → Exit1-IR → Update-IR → Run-Test / Idle →…
[0094]
In such a state transition, the shift register stage of the instruction register 2 (each instruction register 2 shown in FIG. 3 is synchronized with the rising edge of the clock of the TCK signal while the TAP controller 1 is in the Captur-IR state. Each bit of the 5-bit fixed value b'00001 is loaded in parallel on the flip-flop 232) of the cell 200. In the next Shift-IR state, the number of times corresponding to the bit width of the instruction register 2 is repeated.
[0095]
In this embodiment, since the bit width of the instruction register 2 is 5 bits as described above, the host computer gives the TMS signal b′0 to the TAP controller 1 five times in succession so that the TAP controller 1 Performs a state transition that repeats the Shift-IR state five times. At this time, the host computer inputs the instruction code to the TAP controller 1 as a TDI signal in order from the LSB. Specifically, in FIG. 3, data serially input to the instruction register 2 as a TDI signal to the first stage cell 200 is sequentially output from the serial output via the flip flop 232 of each cell 200 to the flip flop 232 of the next stage cell 200. Is output. As a result, b'00001 is serially output from the cell 200 at the final stage as a TDO signal.
[0096]
After the above Shift-IR state has been repeated five times, the host computer outputs the b'1 TMS signal twice in succession. As a result, the TAP controller 1 transits to the Update-IR state via the Exit1-IR state. In the instruction register 2 in synchronization with the falling edge of the clock of the TCK signal while the TAP controller 1 is in the Update-IR state, the data latched in the serial latch (flip-flop 232) of each cell 200 (input as the TDI signal) The data is transferred to the parallel output latch (flip-flop 233) and latched to complete the instruction setting.
[0097]
The instruction set in the instruction register 2 in this way is sent to the instruction decoder 3 and decoded. In synchronization with the state transition of the TAP controller 1, the scan path selection, the test data registers 4, 6, 7 and the like are sent. Designation of writing / reading, selection of the TDO signal output by the multiplexer 8, and generation of signals necessary for each are performed. The operation when the above-described four private instructions are set will be specifically described below.
[0098]
When the SETDINT instruction is set in the instruction register 2, the DINT register 4 is selected as a scan path. Then, the host computer inputs the TMS signal to the TAP controller 1 while changing the value so that the TAP controller 1 performs the following state transition. In all of the following explanations, the timing of the TMS signal and the TCK signal is the same as in the case of the instruction setting described above.
[0099]
Run-Test / Idle → Select-DR-Scan → Captur-DR → Shift-DR → Exit1-DR → Update-DR → Run-Test / Idle →…
[0100]
In such a state transition, the value of the DINT input (PC break DINT input) shown in FIG. 6 is set to the DINT register in synchronization with the rising edge of the clock of the TCK signal while the TAP controller 1 is in the Captur-DR state. 4 flip-flops 432 are loaded. In the Shift-DR state, b′1 is input as a TDI signal from the host computer in order to set the DINT register 4 to the DINT state. Since the DINT register 4 is 1 bit wide, the number of transitions of Shift-DR is one. At this time, the current DINT value is output as the TDO signal.
[0101]
The DINT register is synchronized with the falling edge of the TCK signal clock while the TAP controller 1 is in the Update-DR state as the state transition proceeds from the Captur-DR state through the Shift-DR state and Exit1-DR state. 4, the data latched in the serial latch (flip-flop 432) (data input from the TDI) is transferred to the parallel output latch (flip-flop 433), and the OR gate 14 shown in FIG. Then, it is sent to the flag register 5. As a result, the DINT flag of the flag register 5 is set.
[0102]
When the RD_PC instruction is set in the instruction register 2, the program counter 7 is selected as a scan path. Then, the host computer inputs the TMS signal to the TAP controller 1 while changing its value so that the TAP controller 1 performs the following state transition.
[0103]
Run-Test / Idle → Select-DR-Scan → Captur-DR → Shift-DR (16 times) → Exit1-DR → Update-DR → Run-Test / Idle →…
[0104]
In such a state transition, the value (PC value) of the program counter 7 at that time is loaded into the serial latch in synchronization with the rising edge of the clock of the TCK signal while the TAP controller 1 is in the Captur-DR state. Specifically, in each cell 700 shown in FIG. 8, the operation in which the value of the data latch 730 is loaded into the flip-flop 732 via the multiplexer 731 is 16 bits wide because the program counter 7 is 16 bits wide. It is executed simultaneously on 16 serial registers (flip-flops 732) connected to the serial of 700 cells.
[0105]
In the next Shift-DR state after the Captur-DR state, writing to the program counter 7 is not possible, so the host computer outputs the provisional value h'ffff as the TDI signal and inputs it to the program counter 7. However, any provisional value does not affect the operation. Then, by repeating the Shift-DR state 16 times, the value of the 16-bit program counter 7 loaded in the flip-flop 732 of each cell 700 of the program counter 7 in the previous Captur-DR state is changed from the LSB side. Serial output as TDO signal. Note that nothing happens in the Update-IR state.
[0106]
When the RD_Trans instruction is set in the instruction register 2, the transfer register 6 is selected as a scan path. Then, the host computer inputs the TMS signal to the TAP controller 1 while changing the value so that the TAP controller 1 performs the following state transition.
[0107]
Run-Test / Idle → Select-DR-Scan → Captur-DR → Shift-DR (16 times) → Exit1-DR → Update-DR → Run-Test / Idle →…
[0108]
In such a state transition, the value of the transfer register 6 at that time is loaded into the serial latch in synchronization with the rising edge of the clock of the TCK signal while the TAP controller 1 is in the Captur-DR state. Specifically, in each cell 600 shown in FIG. 7, the operation in which the value of the data latch 630 is loaded into the flip-flop 632 via the multiplexer 631 is the serial number because the transfer register 6 is 16 bits wide. It is executed simultaneously on 16 serial registers connected to.
[0109]
When the RD_Trans instruction is executed, since the write to the transfer register 6 is not performed in the Shift-DR state during the state transition described above, the host computer outputs the provisional value h'ffff as the TDI signal and inputs it to the transfer register 6. . However, any provisional value does not affect the operation. Then, by repeating the Shift-DR state 16 times, the 16-bit value loaded in the flip-flop 632 of each cell 600 of the transfer register 6 in the previous Captur-DR state is serialized as a TDO signal from the LSB side. Is output. Note that nothing happens in the Update-IR state.
[0110]
Even when the WR_Trans instruction is set in the instruction register 2, the transfer register 6 is selected as the scan path as in the case of the above-described DR-Trans instruction. Then, the host computer inputs the TMS signal to the TAP controller 1 while changing the value so that the TAP controller 1 performs the following state transition.
[0111]
Run-Test / Idle → Select-DR-Scan → Captur-DR → Shift-DR (16 times) → Exit1-DR → Update-DR → Run-Test / Idle →…
[0112]
In such a state transition, the value of the transfer register 6 at that time is loaded into the serial latch in synchronization with the rising edge of the clock of the TCK signal while the TAP controller 1 is in the Captur-DR state. Specifically, in each cell 600 shown in FIG. 7, the operation in which the value of the data latch 630 is loaded into the flip-flop 632 via the multiplexer 631 is the serial number because the transfer register 6 is 16 bits wide. It is executed simultaneously on 16 serial registers connected to.
[0113]
While the state transition advances from the Captur-DR state described above and the TAP controller 1 is in the Shift-DR state, an arbitrary value can be input from the host computer to the transfer register 6 as the TDI signal. At this time, the 16-bit input value is input from the LSB side. On the other hand, by repeating the Shift-DR state 16 times, the value loaded in the flip-flop 632 of each cell 600 of the transfer register 6 in the previous Captur-DR state is serially output from the LSB side as the TDO signal. .
[0114]
The transfer register 6 enters the serial latch in synchronization with the falling edge of the TCK signal clock while the TAP controller 1 is in the Update-DR state after the state transition further proceeds from the above-mentioned Shift-DR state. Certain data (data input as a TDI signal) is transferred to the parallel output latch and set in the transfer register 6. Specifically, the data latched in the flip-flop 632 in FIG. 7 is latched in the flip-flop 633, and the output is further latched in the data latch 630 through the multiplexer 634 and the multiplexer 635. This operation is executed simultaneously for all 16-bit latches.
[0115]
The debugging apparatus of the present invention performs debugging using the above-described four private instructions, and details thereof will be described below. By the way, in general, debug devices need to set the registers in the LSI chip to be debugged, specify memory read / write, set breakpoints (PC value to stop program execution for debugging), etc. . At this time, it is necessary to perform a handshake between the LSI chip to be debugged and the host computer to be debugged.
[0116]
When the DINT flag of the flag register 5 is set during the operation of the LSI chip, the value of the program counter 7 (PC value) is set to the head address where the monitor program whose flowchart is shown in FIG. 9 is stored. The monitor program is executed. There are the following three conditions for setting the DINT flag.
[0117]
First condition: When b'1 is set to pin input DINT of LSI chip
Second condition: Breaking by PC value
Third condition: When SETDINT instruction is executed
[0118]
However, the second condition among the above three conditions is a condition for detecting and breaking when a specific address in the program memory 9 is executed (trying to execute), and is not directly related to the present invention. Therefore, the details are omitted.
[0119]
In FIG. 9, when the monitor program is executed, first, as a first procedure, context saving is performed to save in advance the register contents that may be destroyed by execution of debugging (step S11). The subsequent procedure differs depending on whether writing to the transfer register 6, reading, or end of the monitor program. In order to process this conditional branch by the monitor program, a CHCK_DINT routine (step S12) described later is used. The After execution, the start address of the program describing the desired processing is written from the host computer to the transfer register 6, and the value is transferred to the program counter (PC) 7 (step S13). As a result, the process jumps to the address describing the desired process.
[0120]
First, processing in the case of writing to the transfer register 6 will be described. This process is also used in the above-described conditional branch. Basically, a desired value may be written into the LSI chip from the host computer using the WR_Trans instruction, but it is necessary to detect the state on the LSI chip side and write it at an appropriate timing. This timing synchronization is shown in FIG.
[0121]
As shown in FIG. 11, before executing the WR_Trans instruction, the host computer issues an RD_PC instruction (step S21) and observes the execution program address of the LSI chip. On the other hand, since the monitor program as shown in FIG. 9 is executed on the LSI chip side, the process is transferred to the CHCK_DINT routine which is a temporary suspension process in the monitor program (step S14). This CHCK_DINT routine (step S100) is composed of two loops as shown in the flowchart of FIG. 10. The first loop (step S101) is waiting for DINT → b'0, and the next loop (step S100). Step S102) is waiting for DINT → b′1. Since the CHCK_DINT routine (step S100) is assigned to a fixed address in the program memory, any loop is executed by observing the PC value being executed by the RD_PC instruction from outside the LSI chip (host computer). Can be detected.
[0122]
In the monitor program, the first DINT → b′0 waiting loop is canceled when the DINT flag in the flag register 5 becomes b′0. During execution of the monitor program, the DINT flag is cleared by issuing an instruction other than the SETDINT instruction. Therefore, the DRD flag is cleared by issuing the RD_PC instruction from the host computer, and the next DINT → b'1 wait loop is entered. The DINT → b′1 waiting loop is canceled when the DINT flag in the flag register 5 becomes b′1. During execution of the monitor program, the DINT flag is set by issuing the SETDINT instruction, and the DINT → b'1 wait loop is released. In other words, the monitor program is effectively stopped by repeating the DINT → b′1 wait loop until the SETDINT instruction is issued from the host computer.
[0123]
The host computer observes the execution PC value of the LSI chip using the RD_PC instruction, confirms that the monitor program is stopped in the DINT → b'1 wait loop, and then sends the desired value to the transfer register 6 using the WR_Trans instruction (step S23). Write the value.
[0124]
After the completion of the writing of the desired value to the transfer register 6, the host computer issues a SETDINT instruction to release the loop and restart the monitor program stopped in the DINT → b'1 wait loop (step S24). ). The monitor program releases the DINT → b'1 wait loop by the SETDINT command from the host computer and continues the next processing described in the program memory. As a process of the monitor program after the writing to the transfer register 6 is completed, a process of transferring from the transfer register 6 to a register or a memory that can be transferred via a bus (internal bus 12, local bus 13) connected to the transfer register 6 is considered. (Step S15).
[0125]
A program necessary for these processes is stored in the program memory 9 in advance as a monitor program. Even if such a program is not stored in the program memory 9, if the monitor program is provided with a process for transferring the contents of the transfer register 6 to the RAM area 91 of the program memory, the program is transferred to the transfer register 6 from the host computer. It is also possible to add a monitor program by performing the writing process.
[0126]
Next, processing in the case of reading from the transfer register 6 will be described. Basically, the host computer may read the value of the transfer register 6 using the RD_Trans instruction, but it is necessary to detect the state on the LSI chip side and read it at an appropriate timing. This timing synchronization is shown in FIG.
[0127]
As shown in FIG. 12, before executing the RD_Trans instruction, the host computer issues an RD_PC instruction (step S31) and observes the execution program address of the LSI chip. On the other hand, since the monitor program as shown in FIG. 9 is executed on the LSI chip side, the process of transferring to the transfer register 6 (step S16) is executed, and then the CHCK_DINT routine (step S17) in the monitor program is executed. Processing is transferred. The process of transferring to the transfer register 6 may be a process of transferring from a register or memory that can be transferred to the transfer register 6 via a bus (internal bus 12, local bus 13) connected to the transfer register 6.
[0128]
A program necessary for these processes is stored in advance in the program memory as a monitor program. Even if such a program is not stored in the program memory 9, if the monitor program is provided with a process for transferring the contents of the transfer register 6 to the RAM area 91 of the program memory, the program is transferred to the transfer register 6 from the host computer. It is possible to add a monitor program by performing the writing process.
[0129]
The host computer observes the execution PC value of the LSI chip with the RD_PC instruction (step S31) and confirms that the monitor program is stopped in the DINT → b'1 wait loop (step S32), and then the RD_Trans instruction (step S33). ) To read the value from the transfer register 6. After the reading from the transfer register 6 is completed, the host computer issues a SETDINT instruction to release the loop and restart the monitor program stopped in the DINT → b′1 waiting loop (step S34). The monitor program releases the DINT → b'1 wait loop by the SETDINT command from the host computer and continues the next processing described in the program memory.
[0130]
Writing / reading to all registers / memory (program memory 9, internal register 10, internal memory 11, etc.) connected to transfer register 6 is possible by a combination of the above-described write / read processing to transfer register 6. It becomes. As mentioned above, in order to enable writing / reading to / from all registers / memory, it is necessary to prepare transfer processing between the transfer register 6 and all registers / memory using a monitor program. is there. However, if a process for transferring the contents of the transfer register 6 to the RAM area 91 of the program memory 9 is prepared in the monitor program, the monitor program can be added by a write process to the transfer register 6 from the host computer. Become.
[0131]
When these series of processes are completed, the monitor program ends, the register contents saved in context when the monitor program is executed are restored to the original state (step S18), and the process returns to the address before the monitor program is executed. As a method for terminating the monitor program, the start address of the context restore routine in the monitor program is written to the transfer register 6 by the writing process to the transfer register 6 from the host computer. Since the monitor program is programmed to transfer the contents of the transfer register 6 to the program counter 7 at the end of processing, the monitor program jumps to the address written in the transfer register 6. In this case, it is possible to jump to the context restore routine and return from the monitor program.
[0132]
[Embodiment 2]
The CHCK_DINT routine (FIG. 10) of the monitor program (FIGS. 9, 11, and 12) stored in the program memory 9 in the first embodiment is composed of two loops. This processing can be realized by a halt instruction for stopping the processing at a specific address in addition to a method for realizing the program by loop execution as in the first embodiment.
[0133]
In this case, two modes of releasing DINT = b′0 and releasing DINT = b′1 are necessary as modes for releasing the halt. By using the DINT = b′0 release mode halt instruction in the first loop of the CHCK_DINT routine of FIG. 10 and the DINT = b′1 release mode halt instruction in the second loop, respectively, A similar operation can be realized. FIG. 13 shows a flowchart in the case of such a halt command.
[0134]
In FIG. 13, this CHCK_DINT routine (step S200) is composed of two halt instructions. The first halt instruction (step S201) is DINT = b'0 release, and the next halt instruction (step S202) is DINT = b'1 is released. Since the CHCK_DINT routine (step S200) is assigned to a fixed address in the program memory, any halt instruction can be executed by observing the PC value being executed with the RD_PC instruction from outside the LSI chip (host computer). Can be detected.
[0135]
In the above embodiments, specific numerical values are given for the bit widths of the instruction register 2, instruction decoder 3, DINT register 4, flag register 5, transfer register 6, program counter 7, etc. It is not limited to. In each of the above embodiments, an example in which the debugging device of the present invention is connected to a host computer is shown, but the device is not limited to a host computer as long as it is a device capable of JTAG access.
[0136]
【The invention's effect】
As described above in detail, according to the debugging device of the present invention, which register or memory (program memory, internal register, internal memory, etc.) is connected to the transfer memory when writing or reading data. Since this is performed by the monitor program, there is an effect that it is possible to realize a flexible debugging device that does not require dedicated hardware and can easily change and expand the transfer source and destination.
[0137]
In addition, when reading data, it is possible to detect the end of data transfer from the register to the transfer memory and the memory (program memory to the transfer register, internal register, internal memory, etc.) by monitoring the value of the program counter. Does not require hardware.
[0138]
In addition, the program can be re-executed once execution of the program is stopped.
[0139]
Furthermore, at least a part of the contents of a plurality of storage means (internal register, internal memory) connectable to the transfer register can be output to the outside.
[0140]
In addition, any program can be externally written to the writable / readable program memory (RAM area), so the transfer program between the debug target register, memory, etc. and the transfer register can be externally written and read. It is possible to arbitrarily select a debug target by writing to a simple program memory (RAM area).
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of a debugging device according to the present invention.
FIG. 2 is a state transition diagram showing a transition state of the TAP controller of the debugging device of the present invention.
FIG. 3 is a block diagram showing a configuration example of a cell of each bit constituting an instruction register of the debugging device of the present invention.
FIG. 4 is a list showing the operation of the instruction register of the debugging device of the present invention.
FIG. 5 is a list of instructions used by the debugging apparatus of the present invention.
FIG. 6 is a block diagram illustrating a configuration example of a DINT register of the debugging device according to the present invention.
FIG. 7 is a block diagram showing a configuration example of a cell of each bit constituting a transfer register of the debugging device of the present invention.
FIG. 8 is a block diagram showing a configuration example of each bit cell constituting the program counter of the debugging device of the present invention.
FIG. 9 is a flowchart of a monitor program of the debugging device of the present invention.
FIG. 10 is a flowchart of a CHCK_DINT routine according to the first embodiment of the monitor program of the debugging device of the present invention.
FIG. 11 is a flowchart of a write process to a transfer register of the debug device of the present invention.
FIG. 12 is a flowchart of a read process from a transfer register of the debug device according to the present invention.
FIG. 13 is a flowchart of a CHCK_DINT routine according to the second embodiment of the monitor program of the debugging device of the present invention.
FIG. 14 is a block diagram illustrating a configuration example of a conventional debugging device.
[Explanation of symbols]
1 TAP controller, 2 instruction register, 3 instruction decoder, 4 DINT register, 5 flag register, 6 transfer register, 7 program counter,
9 Program memory, 10 internal registers, 11 internal memory, 91 RAM area.

Claims (6)

外部入力信号に応じて動作する制御回路と、
前記制御回路に制御されたアクセスにより所定の命令の外部からの入力が可能な命令レジスタと、
前記命令レジスタの内容をデコードする命令デコーダと、
前記制御回路に制御されたアクセスによりその内容の外部への出力が可能であり、実行されるべきプログラムアドレスを生成するプログラムカウンタと、
前記プログラムカウンタの値に従ってアクセスされるプログラムメモリと
を備え、
前記プログラムメモリは、特定の処理の終了後に所定のアドレス以降のアドレスを実行しない一時休止処理を含むプログラムを格納しており、
前記所定の命令が前記命令デコーダによりデコードされた場合に前記制御回路が前記プログラムカウンタをアクセスしてその値を外部へ出力させることにより、前記一時休止処理のアドレスが出力された場合に前記特定の処理の終了が検知されるべくなしてあることを特徴とするデバッグ装置。
A control circuit that operates in response to an external input signal;
An instruction register capable of inputting a predetermined instruction from the outside by controlled access to the control circuit;
An instruction decoder for decoding the contents of the instruction register;
A program counter for generating a program address to be executed, the contents of which can be output to the outside by controlled access to the control circuit;
A program memory accessed according to the value of the program counter,
The program memory stores a program including a pause process that does not execute an address after a predetermined address after the end of a specific process,
When the predetermined instruction is decoded by the instruction decoder, the control circuit accesses the program counter and outputs the value to the outside. A debugging device characterized in that the end of processing is detected.
プログラムメモリに格納されている一時休止処理は、特定の処理の終了後に所定のアドレス間をループするプログラムであることを特徴とする請求項1記載のデバッグ装置。2. The debugging apparatus according to claim 1, wherein the temporary suspension process stored in the program memory is a program that loops between predetermined addresses after the end of the specific process. プログラムメモリに格納されている一時休止処理は、特定の処理の終了後に特定のアドレスでプログラムの実行を待機するプログラムであることを特徴とする請求項1記載のデバッグ装置。2. The debugging apparatus according to claim 1, wherein the temporary suspension process stored in the program memory is a program that waits for execution of the program at a specific address after completion of the specific process. 制御回路に制御されたアクセスにより外部から入力された信号の値の保持が可能な第1のレジスタと、
前記第1のレジスタに保持された信号値を任意のタイミングで外部から入力される信号に同期して保持し、この値に従って一時休止処理を解除する第2のレジスタと
を備えたことを特徴とする請求項1記載のデバッグ装置。
A first register capable of holding the value of a signal input from the outside by controlled access to the control circuit;
And a second register that holds the signal value held in the first register in synchronization with an externally input signal at an arbitrary timing and releases the pause processing according to the value. The debugging device according to claim 1.
制御回路に制御されたアクセスによりその内容の外部への出力が可能であると共に、複数の記憶手段と接続可能な転送レジスタを備え、
プログラムメモリは、前記転送レジスタと接続可能な複数の記憶手段の内の少なくとも一部と前記転送レジスタとの間の転送プログラムを格納しており、
所定の命令が命令デコーダによりデコードされた場合に前記制御回路が前記転送レジスタをアクセスしてその値を外部へ出力させることにより、前記転送レジスタと接続可能な複数の記憶手段の内の少なくとも一部の内容の外部への出力を可能になしてあることを特徴とする請求項1記載のデバッグ装置。
It is possible to output the contents to the outside by controlled access to the control circuit, and has a transfer register that can be connected to a plurality of storage means,
The program memory stores a transfer program between at least a part of a plurality of storage means connectable to the transfer register and the transfer register,
When a predetermined instruction is decoded by an instruction decoder, the control circuit accesses the transfer register and outputs the value to the outside, so that at least a part of a plurality of storage means connectable to the transfer register 2. The debugging apparatus according to claim 1, wherein the content of the message can be output to the outside.
プログラムメモリの一部に、転送レジスタと接続し、プログラムカウンタの値によりアクセス可能であり且つ書き込み,読み出し可能な領域を有し、
制御回路の制御により転送レジスタをアクセスすることにより、前記書き込み,読み出し可能なプログラムメモリに外部から任意のプログラムの書き込みを可能になしてあることを特徴とする請求項5記載のデバッグ装置。
A part of the program memory is connected to a transfer register, has an area that can be accessed by the value of the program counter, and can be written and read,
6. The debugging apparatus according to claim 5, wherein an arbitrary program can be written to the writable / readable program memory by accessing a transfer register under the control of a control circuit.
JP04489396A 1996-03-01 1996-03-01 Debug device Expired - Fee Related JP3698478B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04489396A JP3698478B2 (en) 1996-03-01 1996-03-01 Debug device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04489396A JP3698478B2 (en) 1996-03-01 1996-03-01 Debug device

Publications (2)

Publication Number Publication Date
JPH09237200A JPH09237200A (en) 1997-09-09
JP3698478B2 true JP3698478B2 (en) 2005-09-21

Family

ID=12704172

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04489396A Expired - Fee Related JP3698478B2 (en) 1996-03-01 1996-03-01 Debug device

Country Status (1)

Country Link
JP (1) JP3698478B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6532553B1 (en) * 1998-12-08 2003-03-11 Arm Limited Debugging data processing systems

Also Published As

Publication number Publication date
JPH09237200A (en) 1997-09-09

Similar Documents

Publication Publication Date Title
US6574762B1 (en) Use of a scan chain for configuration of BIST unit operation
US5708773A (en) JTAG interface system for communicating with compliant and non-compliant JTAG devices
US6854029B2 (en) DSP bus monitoring apparatus and method
US6594802B1 (en) Method and apparatus for providing optimized access to circuits for debug, programming, and test
US6996747B2 (en) Program counter trace stack, access port, and serial scan path
US6704895B1 (en) Integrated circuit with emulation register in JTAG JAP
US7313739B2 (en) Method and apparatus for testing embedded cores
US5828825A (en) Method and apparatus for pseudo-direct access to embedded memories of a micro-controller integrated circuit via the IEEE test access port
US5329471A (en) Emulation devices, systems and methods utilizing state machines
US5805792A (en) Emulation devices, systems, and methods
US5841670A (en) Emulation devices, systems and methods with distributed control of clock domains
US6311302B1 (en) Method and arrangement for hierarchical control of multiple test access port control modules
US6522985B1 (en) Emulation devices, systems and methods utilizing state machines
US5621651A (en) Emulation devices, systems and methods with distributed control of test interfaces in clock domains
US6085336A (en) Data processing devices, systems and methods with mode driven stops
US7533315B2 (en) Integrated circuit with scan-based debugging and debugging method thereof
US20020013918A1 (en) Devices, systems and methods for mode driven stops
US6760866B2 (en) Process of operating a processor with domains and clocks
JP2003076578A (en) Microcomputer, debugging system and trace information collecting method
US20040193957A1 (en) Emulation devices, systems and methods utilizing state machines
US20040250150A1 (en) Devices, systems and methods for mode driven stops notice
JP3484181B1 (en) Semiconductor test circuit
EP0411904A2 (en) Processor condition sensing circuits, systems and methods
US6349392B1 (en) Devices, systems and methods for mode driven stops
EP0685793A2 (en) Emulation device, system and method with distributed control of test interfaces in clock domains

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050311

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050419

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050607

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: 20050705

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050705

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080715

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090715

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100715

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110715

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110715

Year of fee payment: 6

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: 20110715

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees