JP2002163126A - Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit - Google Patents

Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit

Info

Publication number
JP2002163126A
JP2002163126A JP2000361851A JP2000361851A JP2002163126A JP 2002163126 A JP2002163126 A JP 2002163126A JP 2000361851 A JP2000361851 A JP 2000361851A JP 2000361851 A JP2000361851 A JP 2000361851A JP 2002163126 A JP2002163126 A JP 2002163126A
Authority
JP
Japan
Prior art keywords
instruction
event
address
signal
stage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2000361851A
Other languages
Japanese (ja)
Inventor
Akira Nanao
昌 七尾
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 Micro Systems Co Ltd
Original Assignee
Renesas Micro Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Micro Systems Co Ltd filed Critical Renesas Micro Systems Co Ltd
Priority to JP2000361851A priority Critical patent/JP2002163126A/en
Publication of JP2002163126A publication Critical patent/JP2002163126A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a development support device generating no difference between a command subject to event detection and a command indicated by a present program counter PC. SOLUTION: This event detecting circuit is provided with an event command decoding means 104 comprising a command decoding means 121 decoding a command read in a command fetch stage, a command code analyzing means 131 extracting a load command and a store command from the read command and stopping the decoding of the succeeding command for a predetermined period and an address generating means 132 generating the access address of the read command and an event processing means 105 generating the address coincidence signal for interrupting a command executing means 151 to invalidate the command process stage subsequent to the execution stage of the succeeding command when the access address coincides with the predetermined event address.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は開発支援装置のデバ
ッグ用CPUに内蔵のイベント検出回路、イベント検出
方法および外部周辺回路に係わり、特にCPUが命令デ
コードを行うタイミングでイベント用に新たに設けたイ
ベント用命令デコード処理を行うことにより、データア
クセスのイベント検出を使用した場合、イベント検出の
対象となった命令と現在のPCが指し示す命令との間に
差が生じることがないように改善したデバッグ用CPU
に内蔵のイベント検出回路、イベント検出方法および外
部周辺回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an event detection circuit, an event detection method, and an external peripheral circuit incorporated in a debugging CPU of a development support apparatus. In particular, the present invention newly provides an event at the timing when the CPU decodes an instruction. Debug improved by performing event instruction decode processing so that when event detection of data access is used, there is no difference between the instruction targeted for event detection and the instruction indicated by the current PC CPU
The present invention relates to a built-in event detection circuit, an event detection method, and an external peripheral circuit.

【0002】[0002]

【従来の技術】近年、半導体素子の微細化の進展に伴
い、半導体素子で構成されるマイクロコンピュータの機
能も複雑かつ大規模化し、家電製品、パーソナルコンピ
ュータ、OA関連機器、工業用機器等に広く利用されて
いる。
2. Description of the Related Art In recent years, with the progress of miniaturization of semiconductor elements, the functions of microcomputers composed of semiconductor elements have become complicated and large-scale, and have been widely used in home appliances, personal computers, OA-related equipment, industrial equipment, and the like. It's being used.

【0003】これらの機器に応用されるマイクロコンピ
ュータの対象とするプログラム容量も年々増大している
ので、マイコン応用製品開発も仕様の複雑化とともにプ
ログラム容量の増加による開発時間の増大となって現れ
ている。
Since the target program capacity of microcomputers applied to these devices is increasing year by year, the development of microcomputer application products is becoming more complicated and the development time is increasing due to the increase in program capacity. I have.

【0004】しかし、市場の要求に答えるためには短時
間で、複雑化したプログラム開発に対処しなければなら
ず、効率的なマイコン開発支援装置が必要となる。
However, in order to respond to market demands, it is necessary to deal with complicated program development in a short time, and an efficient microcomputer development support device is required.

【0005】上述したマイコン開発支援装置に搭載する
デバッグ用CPUにはイベント検出回路が含まれてい
る。この従来のイベント検出回路において、メモリアク
セス検出は、メモリアクセスの対象となるアドレスに出
力されるデータバス上のデータを比較することで行って
いた。
[0005] The debug CPU mounted on the microcomputer development support device described above includes an event detection circuit. In this conventional event detection circuit, memory access detection is performed by comparing data on a data bus output to an address targeted for memory access.

【0006】その一例が特開平11−167500号公
報に記載されている。同公報記載のイベント回路の構成
を示した図13を参照すると、このデバッグシステムは
デバッガ901,エミュレータ装置902,MCU90
3,イベント回路904から構成され、イベント回路9
04は、アドレスバスおよびデータバスの値を変数と比
較することでメモリアクセスイベントを検出するもので
ある。
[0006] One example is described in JP-A-11-167500. Referring to FIG. 13 showing the configuration of an event circuit described in the publication, the debug system includes a debugger 901, an emulator device 902, and an MCU 90.
3, an event circuit 904;
04 detects a memory access event by comparing the values of the address bus and the data bus with variables.

【0007】すなわち、イベント回路904は、MCU
903から出力されるアドレスバス上のアドレス値
(F)とデータバス上のデータ値(M)をアドレス比較
回路907および変数値一致検出&保持回路906で比
較し、その比較結果(H)をAND回路908およびA
ND回路910で演算した後、イベント回路904の外
部に変数アクセス結果(J)および変数値条件一致結果
(N)としてそれぞれ出力する。これらの信号によりイ
ベント検出を行うことができるというものである。
[0007] That is, the event circuit 904 includes the MCU
The address value (F) on the address bus output from the address bus 903 and the data value (M) on the data bus are compared by the address comparison circuit 907 and the variable value coincidence detection & holding circuit 906, and the comparison result (H) is ANDed. Circuit 908 and A
After the calculation by the ND circuit 910, the result is output to the outside of the event circuit 904 as a variable access result (J) and a variable value condition match result (N), respectively. Event detection can be performed by these signals.

【0008】一方、実行された命令の命令アドレスをデ
バッグ用ツールに容易に取り込ませることが出来る例が
特開平8−171505号公報に記載されている。
On the other hand, an example in which an instruction address of an executed instruction can be easily taken into a debugging tool is described in JP-A-8-171505.

【0009】同公報記載の半導体装置によれば、CPU
とデバッグユニットを備え、デバッグユニットは、CP
Uから出力された命令アドレスについてパイプライン制
御を行いその出力をデバッグツールに命令アドレスとし
て出力するパイプライン(IFステージラッチ、IDス
テージラッチ、MAステージラッチ)と、CPUから出
力されたリード信号についてパイプライン制御を行いそ
の出力をデバッグツールにリードストローブ信号として
出力するパイプライン(IFステージラッチ、IDステ
ージラッチ、MAステージラッチ)との2組のパイプラ
インを有する。
According to the semiconductor device described in the publication, the CPU
And a debugging unit, and the debugging unit is a CP
A pipeline (IF stage latch, ID stage latch, MA stage latch) for performing pipeline control on an instruction address output from U and outputting the output as an instruction address to a debug tool, and a pipe for a read signal output from the CPU. There are two sets of pipelines (IF stage latch, ID stage latch, MA stage latch) that perform line control and output the output to a debug tool as a read strobe signal.

【0010】この装置では、CPUが命令1(分岐命
令)→命令2→命令3→命令4(分岐先の命令)→命令
5の順に命令1から5をフェッチした場合、命令2はI
F2→ID2の2ステージまで実行され、それ以降のス
テージは実行されず、命令3はIF3ステージのみ実行
され、それ以降のステージは実行されない。
In this device, when the CPU fetches instructions 1 to 5 in the order of instruction 1 (branch instruction) → instruction 2 → instruction 3 → instruction 4 (branch destination instruction) → instruction 5, instruction 2
Instruction 2 is executed up to two stages of ID2, the subsequent stages are not executed, instruction 3 is executed only in IF3 stage, and the subsequent stages are not executed.

【0011】その結果、デバッグツールに出力される命
令アドレスは、命令1のMA1(メモリアクセス)ステ
ージのタイミングにおいて命令1のIF1が出力され、
命令4のメモリアクセスステージのタイミングにおいて
命令4のIF4が出力され、命令5のメモリアクセスス
テージのタイミングにおいて命令5のIF5がが出力さ
れる。すなわちキャンセルされた命令2,命令3のアド
レスは出力されずブランクで、“IF1”→“−”→
“−”→“IF4”→“IF5”の順になる。
As a result, the instruction address output to the debug tool is such that IF1 of instruction 1 is output at the timing of the MA1 (memory access) stage of instruction 1,
The IF4 of the instruction 4 is output at the timing of the memory access stage of the instruction 4, and the IF5 of the instruction 5 is output at the timing of the memory access stage of the instruction 5. That is, the addresses of the canceled instructions 2 and 3 are not output and are blank, and “IF1” → “−” →
The order is “−” → “IF4” → “IF5”.

【0012】このように命令を実行された命令アドレ
ス、すなわち、IF1、IF4、IF5に使用された命
令アドレスのみがデバッグ用ツールに出力されるととも
に、これらIF1、IF4、IF5に使用された命令ア
ドレスのリードストローブの指示がデバッグ用ツールに
対して行われる。
The instruction address at which the instruction was executed in this manner, that is, only the instruction address used for IF1, IF4, IF5 is output to the debugging tool, and the instruction address used for these IF1, IF4, IF5 is used. Is given to the debug tool.

【0013】従って、CPUから出力される命令アドレ
スを全てデバッグ用ツールに出力する従来の構成のデバ
ッグユニットを設ける必要がない、というものである。
Therefore, there is no need to provide a debug unit having a conventional configuration for outputting all instruction addresses output from the CPU to the debugging tool.

【0014】[0014]

【発明が解決しようとする課題】ここで、パイプライン
処理のタイミングチャート例を示した図14を参照する
と、一般にパイプライン処理を用いたCPUでは、命令
フェッチステージ(IF)、命令デコードステージ(I
D)、命令実行ステージ(EX)、MEMステージ(M
EM)、WBステージ(WB)の順に処理される。この
手順の中でMEMはメモリアクセスを、WBはレジスタ
へのライトバックを表す。
Here, referring to FIG. 14 showing an example of a timing chart of the pipeline processing, a CPU using the pipeline processing generally has an instruction fetch stage (IF) and an instruction decode stage (I).
D), instruction execution stage (EX), MEM stage (M
EM) and WB stage (WB). In this procedure, MEM indicates memory access, and WB indicates write-back to a register.

【0015】そのようなパイプライン処理を行うことを
考慮すると、上述した特開平11−167500号公報
に示した例では次のような問題点がある。すなわち、比
較対象となる割付アドレス(G)および比較条件&変数
値(L)を、それぞれアドレスバス上のアドレス値
(F)、およびデータバス上のデータ値(M)と比較し
ている。
Considering the execution of such pipeline processing, the above-described example disclosed in Japanese Patent Laid-Open No. 11-167500 has the following problems. That is, the allocation address (G) and the comparison condition & variable value (L) to be compared are compared with the address value (F) on the address bus and the data value (M) on the data bus, respectively.

【0016】この場合、CPUの命令実行手順における
MEMステージが終了するまでの時間とデータバス上の
データが検出されるまでの時間差とで命令が1命令もし
くは2命令分実行されてしまい、プログラムカウンタP
Cが実際にメモリをアクセスした命令よりも先の命令を
示すことになる。
In this case, one instruction or two instructions are executed by the time until the MEM stage is completed in the instruction execution procedure of the CPU and the time difference until the data on the data bus is detected. P
C indicates an instruction prior to the instruction that actually accessed the memory.

【0017】そのため、データアクセスのイベント検出
を使用した場合、イベント検出の対象となった命令と現
在のプログラムカウンタPCが指し示す命令との間に差
が生じることになる。
Therefore, when the event detection of data access is used, a difference occurs between the instruction targeted for the event detection and the instruction indicated by the current program counter PC.

【0018】このことから、アクセスの対象となった命
令のプログラムカウンタPCを、現在のプログラムカウ
ンタPCから逆上って検索しなくてはならなくなる。
As a result, the program counter PC of the instruction to be accessed must be searched backward from the current program counter PC.

【0019】一方、特開平8−171505号公報に記
載の従来例の場合、命令コードを読み出したアドレス
(フェッチアドレス)であり、後述する本発明の実施形態
では命令自体が対象とするアドレス(アクセスアドレス)
である。つまり、命令コードを処理する場合で考える
と、対象としている部分が異なる。
On the other hand, in the case of the conventional example described in Japanese Patent Application Laid-Open No. 8-171505,
(Fetch address), an address (access address) targeted by the instruction itself in the embodiment of the present invention described later.
It is. That is, when processing the instruction code, the target part is different.

【0020】また、パイプラインを2セット持つデバッ
グユニットが必要でありチップ面積が増加することと、
上述したメモリアクセスにおける問題は解決されない。
Further, a debug unit having two sets of pipelines is required, so that a chip area is increased.
The problem in the memory access described above is not solved.

【0021】本発明の目的は、上述した従来の欠点に鑑
みなされたものであり、CPUが命令デコードを行うタ
イミングでイベント用に新たに設けた命令デコード処理
を行うことにより、メモリアクセスの要因となった命令
の実行ステージを実行した直後にメモリアクセスイベン
トの検出を行って後続する命令に割り込みをかけること
で、上記の問題を解決する手段を提供することにある。
An object of the present invention has been made in view of the above-mentioned drawbacks of the related art. By performing an instruction decoding process newly provided for an event at a timing at which the CPU performs instruction decoding, it is possible to reduce memory access factors. An object of the present invention is to provide a means for solving the above-described problem by detecting a memory access event immediately after executing an execution stage of an instruction that has become invalid and interrupting a subsequent instruction.

【0022】[0022]

【課題を解決するための手段】本発明のイベント検出回
路は、開発対象プログラムのデバッグに用いる開発支援
装置のデバッグ用CPUに内蔵のイベント検出回路にお
いて、命令フェッチステージで読み込んだ命令をデコー
ドする命令デコード手段のほかに、読み込んだ前記命令
からロード命令およびストア命令を抽出し後続する次命
令のデコードを予め定める期間停止させる命令コード解
析手段および読み込んだ前記命令のアクセスアドレスを
生成するアクセスアドレス生成手段からなるイベント用
命令デコード手段と、前記アクセスアドレスおよび予め
設定したイベントアドレスが一致したとき命令実行手段
に割り込みをかけて前記後続する次命令の実行ステージ
以降の命令処理ステージを無効にするためのアドレス一
致信号を生成するイベント処理手段とを備えて構成する
ことを特徴とする。
According to the present invention, there is provided an event detection circuit for decoding an instruction read in an instruction fetch stage in an event detection circuit built in a debug CPU of a development support device used for debugging a development target program. In addition to the decoding means, an instruction code analyzing means for extracting a load instruction and a store instruction from the read instruction and stopping the decoding of a subsequent instruction for a predetermined period, and an access address generating means for generating an access address of the read instruction And an address for invalidating an instruction processing stage after the execution stage of the succeeding next instruction by interrupting the instruction execution unit when the access address and the preset event address match. Generate a match signal Characterized in that it constituted by a venting processor.

【0023】また、前記命令コード解析手段は、前記ロ
ード命令もしくは前記ストア命令をデコードした場合は
そのアドレス算出に必要なレジスタ値が確定するまで前
記命令デコーダの処理を停止させて待機するためのデコ
ード処理制御信号を生成することができる。
When the load instruction or the store instruction is decoded, the instruction code analyzing means stops the processing of the instruction decoder and waits until a register value necessary for calculating the address is determined. A processing control signal can be generated.

【0024】さらに、前記イベント用命令デコード手段
は、前記ロード命令におけるメモリからのデータ読み出
し動作と前記デバッグ用CPUの内部レジスタへのデー
タ格納動作とが完了したタイミングで、命令実行ステー
ジ以降の命令処理ステージの動作を停止させて後続命令
の実行を無効にすることもできる。
Further, the event instruction decoding means may execute the instruction processing after the instruction execution stage at the timing when the data read operation from the memory and the data storage operation to the internal register of the debug CPU in the load instruction are completed. The operation of the stage may be stopped to disable execution of the subsequent instruction.

【0025】さらにまた、前記イベント用命令デコード
手段は、ストア命令におけるメモリへの書き込み動作が
完了したタイミングで、前記命令実行ステージ以降の命
令処理ステージの動作を停止させて後続命令の実行を無
効にすることもできる。
Further, the event instruction decoding means stops the operation of the instruction processing stages after the instruction execution stage at the timing when the write operation to the memory in the store instruction is completed, and invalidates the execution of the subsequent instruction. You can also.

【0026】また、前記イベント用命令デコード手段
は、直前の命令のメモリアクセスステージが完了するま
でデコードステージ以降の命令処理ステージの動作を待
機させるために前記ロード命令および前記ストア命令が
あらかじめ有するアイドル期間に対応させて、前記アイ
ドル期間をもたない後続命令に対しても、前記ロード命
令および前記ストア命令のメモリアクセスステージが完
了するまでデコードステージ以降の命令処理ステージの
動作を待機させるためのデコード停止期間設定用の制御
信号を生成することができる。
The event instruction decoding means may include an idle period which the load instruction and the store instruction have in advance in order to wait for the operation of the instruction processing stage after the decode stage until the memory access stage of the immediately preceding instruction is completed. In response to the above, even for the subsequent instruction having no idle period, decoding is stopped for waiting the operation of the instruction processing stage after the decode stage until the memory access stage of the load instruction and the store instruction is completed. A control signal for setting a period can be generated.

【0027】さらに、前記イベント用命令デコード手段
は、デコード停止期間設定用の制御信号が生成されて
も、前記イベントを検出が有効とならない限りデコード
停止期間後は直ちに後続命令の命令実行ステージ以降の
命令処理ステージを連続して実行することもできる。
Further, even if the control signal for setting the decoding stop period is generated, the event instruction decoding means immediately after the decoding stop period unless the detection of the event becomes valid, immediately after the instruction execution stage of the subsequent instruction. The instruction processing stages can be executed continuously.

【0028】さらにまた、前記命令コード解析手段は、
デコーダとアドレス用レジスタ選択回路と転送用レジス
タ選択回路とを含み、前記デコーダは、命令キューを介
して入力された命令コードを2進データに変換しその2
進データの中で命令の種類を表すビットがロードもしく
はストア命令であれば、前記デコード処理制御信号を命
令デコーダに出力し、前記アドレス用レジスタ選択回路
および前記転送用レジスタ選択回路は、前記2進データ
から命令コードにより指定されたレジスタがどのレジス
タであるがを示す信号として、アドレス用レジスタ選択
信号および転送用レジスタ選択信号のうちのそれぞれ対
応する1つを出力することもできる。
Further, the instruction code analyzing means includes:
A decoder, an address register selection circuit, and a transfer register selection circuit, wherein the decoder converts an instruction code input through an instruction queue into binary data,
If the bit indicating the type of the instruction in the binary data is a load or store instruction, the decoding process control signal is output to the instruction decoder, and the address register selection circuit and the transfer register selection circuit As the signal indicating which register is specified by the instruction code from the data, one corresponding to each of the address register selection signal and the transfer register selection signal can be output.

【0029】また、前記アクセスアドレス生成部は、デ
ータ長拡張用シフタおよびアドレス加算器を含み、前記
データ長拡張用シフタはアドレス生成に必要なデータに
変換するためのアドレスディスプレースメントデータの
ビット幅の符号拡張を行い、前記アドレス加算器は変換
されたディスプレースメントデータである拡張後ディス
プレースメントデータとレジスタ間接アドレッシングの
ためのレジスタデータとを加算し実際にアクセス対象と
なるアクセスアドレスを算出することもできる。
Further, the access address generator includes a data length extension shifter and an address adder, and the data length extension shifter has a bit width of address displacement data for converting into data necessary for address generation. The address adder may perform sign extension and add the extended displacement data, which is the converted displacement data, and the register data for register indirect addressing to calculate an access address to be actually accessed. .

【0030】さらに、前記イベント処理手段は、イベン
トアドレスレジスタおよびアドレスコンパレータを含
み、前記イベントアドレスレジスタは、イベント検出し
たい条件のうちアドレスに関する情報を設定する格納領
域であり外部のイベント管理領域からイベントデータバ
スを介して情報が送られるとイベントイネーブル信号お
よびイベントアドレスを出力し、前記アドレスコンパレ
ータは、比較器のほかに前記命令コード解析手段が生成
するロード命令選択信号と前記ストア命令選択信号とを
受けてどちらか一方が有効の場合にコンパレータイネー
ブル信号を出力する排他的論理和回路を含み、前記イベ
ントアドレスおよび前記アクセスアドレス生成部の出力
するアクセスアドレスの比較結果が一致し、かつ前記コ
ンパレータイネーブル信号の活性化時にアドレス一致検
出信号を出力することができる。
Further, the event processing means includes an event address register and an address comparator. The event address register is a storage area for setting information on an address among conditions to be detected, and stores event data from an external event management area. When information is sent via the bus, an event enable signal and an event address are output, and the address comparator receives a load instruction select signal and the store instruction select signal generated by the instruction code analyzing means in addition to the comparator. An exclusive-OR circuit that outputs a comparator enable signal when one of them is valid, the result of the comparison between the event address and the access address output from the access address generator matches, and Can output an address coincidence detection signal upon activation of the signal.

【0031】さらにまた、ロード命令およびストア命令
に代表されるメモリアクセスを伴う命令を命令デコード
のデコードタイミングでイベント用命令をデコードする
ために命令フェッチ手段出力後の信号遅延短縮手段とし
て、前記イベント検出手段を前記デバッグ用CPUの命
令デコーダに隣接配置したレイアウト構造を有すること
ができる。
Further, as a signal delay reducing means after outputting the instruction fetch means, the event detection means decodes an instruction accompanied by a memory access represented by a load instruction and a store instruction at the decode timing of the instruction decode. The layout means may have a layout structure in which the means is arranged adjacent to the instruction decoder of the debug CPU.

【0032】本発明のイベント検出方法は、プログラム
開発に用いる開発支援装置のデバッグ用CPUに内蔵の
イベント検出回路のイベント検出方法において、前記デ
バッグ用CPUが実行中のデバッグプログラムの命令を
デコードするタイミングと同じタイミングで、前記デバ
ッグプログラムからロード命令またはストア命令のみを
命令コード解析手段によりデコードし後続する次命令の
デコードを予め定める期間停止させるとともに、前記ア
クセスアドレスおよび予め設定したイベントアドレスが
一致したときイベント処理手段の生成するアドレス一致
信号により命令実行手段に割り込みをかけて、前記後続
する次命令の実行ステージ以降の命令処理ステージを無
効にさせることを特徴とする。
According to the event detection method of the present invention, in the event detection method of the event detection circuit built in the debug CPU of the development support device used for program development, the timing at which the debug CPU decodes the instruction of the debug program being executed is provided. At the same timing as above, when only the load instruction or the store instruction from the debug program is decoded by the instruction code analyzing means and the decoding of the subsequent instruction is stopped for a predetermined period, and the access address and the preset event address match. The instruction execution means is interrupted by an address match signal generated by the event processing means, and the instruction processing stages subsequent to the execution stage of the succeeding next instruction are invalidated.

【0033】本発明のデバッグ用CPUに内蔵のイベン
ト回路によるイベント検出方法の他の特徴は、開発支援
装置内のデバッグ用CPUに内蔵のイベント検出回路に
よるイベント検出方法において、命令フェッチステージ
で読み込んだ命令をデコードする命令デコード手段のほ
かに、読み込んだ前記命令からロード命令およびストア
命令を抽出する命令コード解析手段および読み込んだ前
記命令のアクセスアドレスを生成するアクセスアドレス
生成手段とを含むイベント用命令デコード手段と、予め
イベントアドレスが設定されるイベントレジスタ手段と
前記イベントアドレスおよび前記アクセスアドレスを比
較し一致するとアドレス一致信号を出力するアドレスコ
ンパレータとを含むイベント処理手段とを用いて、前記
命令デコード手段と同様のタイミングで並列にデコード
対象命令のデコード処理を行い、前記命令がロード命令
あるいはストア命令であればデコード処理制御信号を出
力して前記命令デコード手段に対し実行中の処理をラッ
チおよび停止させるとともに、前記アクセスアドレス生
成手段によりメモリアクセスの対象となるアドレスを確
定させた後、確定した前記ドレスと前記イベントアドレ
スとが一致するとアドレス一致検出信号を出力させ、こ
のアドレス一致検出信号により命令実行手段内の割り込
み処理部に割り込みを発生させて前記命令実行手段の動
作を停止させることを特徴とする。
Another feature of the method for detecting an event by the event circuit built in the debug CPU of the present invention is that in the event detection method by the event detect circuit built in the debug CPU in the development support device, the event is read in the instruction fetch stage. Instruction decoding for an event including instruction decoding means for decoding an instruction, instruction code analysis means for extracting a load instruction and a store instruction from the read instruction, and access address generation means for generating an access address of the read instruction The instruction decoding means using event register means for setting an event address in advance and an address comparator for comparing the event address and the access address and outputting an address match signal when they match. At the same timing, decode processing of an instruction to be decoded is performed in parallel, and if the instruction is a load instruction or a store instruction, a decode processing control signal is output to latch and stop the processing being executed by the instruction decode means. After the address to be accessed by the memory is determined by the access address generation means, an address match detection signal is output when the determined address matches the event address. In this case, the operation of the instruction execution means is stopped by generating an interrupt in the interrupt processing unit.

【0034】本発明のデバッグ用CPUの外部周辺回路
の特徴は、命令フェッチステージで読み込んだ命令から
ロード命令およびストア命令を抽出し後続する次命令の
デコードを予め定める期間停止させる命令コード解析手
段および読み込んだ前記命令のアクセスアドレスを生成
するアクセスアドレス生成手段からなるイベント用命令
デコード手段と、前記アクセスアドレスおよび予め設定
したイベントアドレスが一致したとき命令実行手段に割
り込みをかけて前記後続する次命令の実行ステージ以降
の命令処理ステージを無効にするためのアドレス一致信
号を生成するイベント処理手段とからなるイベント検出
回路を備えるデバッグ用CPUの外部にトレース部を有
し、前記トレース部は、命令フェッチバス、外部アドレ
スバスおよび外部データバスに接続されプログラム実行
の経過が書き込まれるトレースメモリと、イベントの対
象となった命令が実行された直後に発行される前記アド
レス一致検出信号に応答してイベントデータをイベント
データバスから取り込みライトイネーブル信号を生成し
そのライトイネーブル信号により前記トレースメモリへ
の誤書き込みが生じないようにトレース開始および終了
のタイミングを制御するトレースイベント制御部とを含
んで構成することにある。
The feature of the external peripheral circuit of the debugging CPU of the present invention is that an instruction code analyzing means for extracting a load instruction and a store instruction from instructions read in the instruction fetch stage and stopping the decoding of a subsequent instruction for a predetermined period, and An event instruction decoding means comprising an access address generating means for generating an access address of the read instruction; and interrupting the instruction execution means when the access address and a preset event address match, to interrupt the subsequent next instruction. A trace unit is provided outside a debug CPU provided with an event detection circuit including an event processing unit for generating an address match signal for invalidating an instruction processing stage after the execution stage. The trace unit includes an instruction fetch bus. , External address bus and external A trace memory connected to the data bus to write the progress of program execution, and event data from the event data bus in response to the address match detection signal issued immediately after the instruction of the event is executed. And a trace event control unit for controlling the timing of starting and ending the trace so that a signal is generated and the write enable signal does not cause erroneous writing to the trace memory.

【0035】また、前記トレース部は、前記アドレス一
致検出信号を入力し、トレースの開始、終了を制御する
トレースイベント制御部と、プログラム実行の経過が書
き込まれるトレースメモリとを含み、前記トレースイベ
ント制御部は、イベントデータバスからイベントデータ
を受けるトレースイベント比較部と、このトレースイベ
ント比較部の出力信号および前記アドレス一致検出信号
を受けライトイネーブル信号を出力する論理積回路とを
含んで構成される。
The trace section includes a trace event control section for inputting the address match detection signal and controlling start and end of a trace, and a trace memory in which the progress of program execution is written. The unit includes a trace event comparison unit that receives event data from an event data bus, and an AND circuit that outputs an output signal of the trace event comparison unit and the address match detection signal and outputs a write enable signal.

【0036】本発明のデバッグ用CPUの外部周辺回路
の他の特徴は、命令フェッチステージで読み込んだ命令
からロード命令およびストア命令を抽出し後続命令のデ
コードを予め定める期間停止させる命令コード解析手段
および読み込んだ前記命令のアクセスアドレスを生成す
るアクセスアドレス生成手段からなるイベント用命令デ
コード手段と、前記アクセスアドレスおよび予め設定し
たイベントアドレスが一致したとき命令実行手段に割り
込みをかけて前記後続命令の実行ステージ以降の命令処
理ステージを無効にするためのアドレス一致信号を生成
するイベント処理手段とからなるイベント検出回路を備
えるデバッグ用CPUの外部にタイマ部を有し、前記タ
イマ部は、タイマカウンタと、イベントの対象となった
命令が実行された直後に発行される前記アドレス一致検
出信号に応答してイベントデータをバスから取り込みカ
ウントスタート信号およびカウントストップ信号を生成
しこれら2つの信号により前記タイマカウンタのカウン
ト回数に誤差が生じないようにカウント開始、終了のタ
イミングを制御するタイマイベント制御部とを含んで構
成することを特徴とすることにある。
Another feature of the external peripheral circuit of the debug CPU of the present invention is that an instruction code analyzing means for extracting a load instruction and a store instruction from instructions read in the instruction fetch stage and stopping the decoding of a subsequent instruction for a predetermined period, and An instruction decoding means for an event comprising access address generation means for generating an access address of the read instruction; and an execution stage for executing the subsequent instruction by interrupting the instruction execution means when the access address matches a preset event address. A timer unit is provided outside a debugging CPU having an event detection circuit including an event processing unit for generating an address match signal for invalidating a subsequent instruction processing stage. The timer unit includes a timer counter, The instruction targeted by was executed In response to the address match detection signal issued later, event data is taken from the bus to generate a count start signal and a count stop signal, and the two signals are used to start counting so that an error does not occur in the count number of the timer counter. And a timer event control unit for controlling the end timing.

【0037】また、前記タイマ部は、イベントを使用し
てタイマカウンタの開始、終了を制御するタイマイベン
ト制御部と、イベントによってカウント動作を制御でき
るタイマカウンタとを含み、前記タイマイベント制御部
は、イベントデータを受けて比較するタイマイベント比
較部と、このタイマイベント比較部の出力信号および前
記アドレス一致検出信号を受けカウンタスタート信号を
出力する第1の論理積回路と、前記タイマイベント比較
部の愛2の出力信号および前記アドレス一致検出信号を
受けカウンタストップ信号を出力する第2の論理積回路
とを含んで構成される。
The timer unit includes a timer event control unit that controls the start and end of the timer counter by using an event, and a timer counter that can control a counting operation by the event. A timer event comparator for receiving and comparing the event data, a first AND circuit for receiving the output signal of the timer event comparator and the address match detection signal and outputting a counter start signal, And a second AND circuit that receives the address match detection signal and outputs the counter stop signal.

【0038】[0038]

【発明の実施の形態】本発明のイベント検出回路の概要
は、本発明の第1の実施形態の構成を示した図1を参照
すると、CPUが命令デコードを行うタイミングで、イ
ベント用に新たに設けた命令デコード手段の実行結果を
引用することにより、メモリアクセスの要因となった命
令の実行直後に、メモリアクセスイベントの検出を行う
タイミングを設定することである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An outline of an event detection circuit according to the present invention will be described with reference to FIG. 1 showing a configuration of a first embodiment of the present invention. By referring to the execution result of the provided instruction decoding means, the timing for detecting a memory access event is set immediately after the execution of the instruction that caused the memory access.

【0039】また、この実施形態におけるイベント検出
方法の概要を述べると、まず、イベント用命令デコード
部104は、デバッグ用CPU101が命令実行を行う
手順の一つを処理する命令デコード部103と並列にデ
コード処理を行う。つまり、命令デコード部103と同
様のタイミングでデコード処理を開始する。
An outline of an event detection method according to this embodiment will be described. First, the event instruction decoding unit 104 is arranged in parallel with the instruction decoding unit 103 which processes one of the procedures in which the debug CPU 101 executes an instruction. Perform decoding processing. That is, the decoding process is started at the same timing as that of the instruction decoding unit 103.

【0040】続いて、イベント用命令デコード部104
は、デコード対象となる命令がロードあるいはストア命
令であることを命令コードから判断すると、命令デコー
ド部103に対してデコード処理制御信号を信号線13
9を介して出力し、命令デコーダ121の実行中の処理
をラッチおよび停止する。
Subsequently, the event instruction decoding unit 104
Determines from the instruction code that the instruction to be decoded is a load or store instruction, and sends a decode processing control signal to the instruction decode unit 103 on the signal line 13.
9 to latch and stop the processing being executed by the instruction decoder 121.

【0041】このラッチの停止により、デコードされた
命令の実行に必要な情報であるアドレッシング用レジス
タの内容が確定することになる。これは、命令の実行に
際して未決定の項目が無いことを意味する。
By stopping the latch, the contents of the addressing register, which is information necessary for executing the decoded instruction, are determined. This means that there is no undetermined item when executing the instruction.

【0042】この時点で、メモリアクセスの対象となる
アドレスが確定したので、イベントアドレスレジスタ1
41に設定されているアドレスと比較することができ
る。
At this point, since the address to be accessed by the memory is determined, the event address register 1
It can be compared with the address set in 41.

【0043】そのアドレス比較によりアドレスが一致す
ると、アドレスコンパレータ142はアドレス一致検出
信号を信号線144を介して出力する。
When the addresses match as a result of the address comparison, the address comparator 142 outputs an address match detection signal via the signal line 144.

【0044】このアドレス一致検出信号を命令実行部1
06にある割り込み処理部152に入力することで割り
込み処理部152に割り込みを発生させ、実行ユニット
151を停止させることができる。
The address match detection signal is sent to the instruction execution unit 1
By inputting to the interrupt processing unit 152 at 06, an interrupt can be generated in the interrupt processing unit 152 and the execution unit 151 can be stopped.

【0045】この処理動作により、実行ユニット151
を、その実行動作直後に停止させるという条件で処理さ
せて、実行しようとしたメモリアクセスを伴う命令の実
行ステージを実行直後に後続する命令の実行を停止でき
るというデバッグ効率を向上させる効果が得られる。
By this processing operation, the execution unit 151
Can be processed under the condition that it is stopped immediately after its execution operation, and the execution stage of an instruction involving a memory access to be executed can be stopped immediately after the execution of the subsequent instruction, thereby improving the debugging efficiency. .

【0046】次に本発明の第1の実施の形態を再び図1
を参照しながら説明する。
Next, the first embodiment of the present invention will be described with reference to FIG.
This will be described with reference to FIG.

【0047】図1を参照すると、本発明のイベント検出
回路を搭載するデバッグ用CPU101は、命令フェッ
チ部(IF)102と、命令デコード部(ID)103
と、命令実行部(EX)106と、イベント用命令デコ
ード部104と、イベント処理部105と、内部レジス
タ部107とから構成される。
Referring to FIG. 1, a debug CPU 101 equipped with an event detection circuit according to the present invention includes an instruction fetch unit (IF) 102 and an instruction decode unit (ID) 103.
, An instruction execution unit (EX) 106, an event instruction decoding unit 104, an event processing unit 105, and an internal register unit 107.

【0048】さらに、命令フェッチ部(IF)102は
外部のフェッチバス172が接続され、命令デコード部
(ID)103は内部データバス173が接続され、イ
ベント処理部105には内部イベントデータバス171
が接続され、内部レジスタ部107も内部データバス1
73が接続されている。
The instruction fetch unit (IF) 102 is connected to an external fetch bus 172, the instruction decode unit (ID) 103 is connected to an internal data bus 173, and the event processing unit 105 is connected to an internal event data bus 171.
Are connected, and the internal register unit 107 is also connected to the internal data bus 1.
73 is connected.

【0049】命令フェッチ部102は、バスインタフェ
ース111と命令キュー112とを含んでいる。バスイ
ンタフェース111は、フェッチバス172から命令コ
ードを読み込む。命令キュー112は、バスインタフェ
ース111が読み込んだ命令コードを、バスインタフェ
ース出力バス113を介して順次に格納し、次のステッ
プへ命令コードを出力する。
The instruction fetch unit 102 includes a bus interface 111 and an instruction queue 112. The bus interface 111 reads an instruction code from the fetch bus 172. The instruction queue 112 sequentially stores the instruction codes read by the bus interface 111 via the bus interface output bus 113, and outputs the instruction codes to the next step.

【0050】命令デコード部103は、命令デコーダ1
21を含んでいる。命令デコーダ121は、命令キュー
112から命令キュー出力バス114を介して受け取っ
た命令コードをデコードする。デコードの結果から、1
ビットあるいは複数ビットの情報を用いて命令の動作を
特定することによって、命令実行に必要なアドレスの生
成と、対象となる内部レジスタの選択とを行う。その
後、次のステップとして命令実行部106へデコード出
力バス122を介して、特定された命令の情報を出力す
る。
The instruction decoding unit 103 includes the instruction decoder 1
21. The instruction decoder 121 decodes an instruction code received from the instruction queue 112 via the instruction queue output bus 114. From the decoding result, 1
By specifying the operation of the instruction using information of a bit or a plurality of bits, an address necessary for executing the instruction is generated and a target internal register is selected. Then, as the next step, the information of the specified instruction is output to the instruction execution unit 106 via the decode output bus 122.

【0051】命令実行部106は、実行ユニット151
と割り込み処理部152とを含み、実行ユニット151
は割り込み処理部152で生成される割り込み信号を割
り込み信号線153を介して受け取る。
The instruction execution unit 106 includes an execution unit 151
And an execution unit 151 including
Receives an interrupt signal generated by the interrupt processing unit 152 via an interrupt signal line 153.

【0052】実行ユニット151は、直前のステップで
特定された命令であって、命令デコーダ出力バス122
を介して入力される命令を実行する。
Execution unit 151 is the instruction identified in the immediately preceding step,
Execute the instruction input through the.

【0053】割り込み処理部152は、後述するアドレ
ス一致検出信号をアドレス一致検出信号線144を介し
て受け取ると、実行ユニット151を停止させるために
割り込み信号を割り込み信号線153に出力する。
When receiving an address match detection signal described later via the address match detection signal line 144, the interrupt processing unit 152 outputs an interrupt signal to the interrupt signal line 153 to stop the execution unit 151.

【0054】イベント用命令デコード部104は、ロー
ド/ストア命令コード解析部131とアクセスアドレス
生成部132とを含んでいる。
The event instruction decoding unit 104 includes a load / store instruction code analysis unit 131 and an access address generation unit 132.

【0055】ロード/ストア命令コード解析部131
は、その構成を示した図2を参照すると、デコーダ20
1と論理積回路(ANDゲート)群202とアドレス用
レジスタ選択回路203と転送用レジスタ選択回路20
4と排他的論理和回路(XORゲート)205とを含ん
でいる。
Load / store instruction code analyzer 131
Referring to FIG. 2 showing the configuration, the decoder 20
1, an AND circuit group (AND gate) group 202, an address register selection circuit 203, and a transfer register selection circuit 20
4 and an exclusive OR circuit (XOR gate) 205.

【0056】デコーダ201は、命令キュー出力バス1
14を介して入力された命令コードである16進(HE
X)データを2進(BIN)データに変換し、ビットご
とに処理できるようにする。デコードされた命令コード
の形式を示した図3を参照すると、その命令コード形式
に命令コードと、命令の動作と、略語の説明とで説明さ
れている。
The decoder 201 has an instruction queue output bus 1
Hex (HE), which is the instruction code input through
X) Convert the data to binary (BIN) data so that it can be processed bit by bit. Referring to FIG. 3 showing the format of the decoded instruction code, the instruction code format includes an instruction code, an operation of the instruction, and a description of abbreviations.

【0057】すなわち、記号命令“LD disp
[r],R”に対する命令コードは“dddddddd
RRR01rrr”であり、その命令動作はアクセスア
ドレス領域から転送用レジスタへの転送である(ロード
命令)。
That is, the symbol instruction “LD disp
The instruction code for [r], R "is" dddddddd
RRR01rrr ", and the instruction operation is transfer from the access address area to the transfer register (load instruction).

【0058】また、記号命令“ST R,disp
[r]”に対する命令コードは“ddddddddRR
R10rrr”であり、その命令動作は転送用レジスタ
からアクセスアドレス領域への転送である(ストア命
令)。
The symbol instruction "STR, disp"
The instruction code for “[r]” is “ddddddddRR
R10rrr ", and the instruction operation is a transfer from the transfer register to the access address area (store instruction).

【0059】ここで変換された2進データの中で命令の
種類を表すビット(LSDの4、5ビット目)がロード
もしくはストア命令であれば、デコード処理制御信号を
デコード処理制御信号線139を介して命令デコーダ1
21に出力する。
If the bit (the fourth and fifth bits of the LSD) representing the type of instruction in the converted binary data is a load or store instruction, the decode control signal is sent to the decode control signal line 139. Instruction decoder 1 through
21.

【0060】アドレス用レジスタ選択回路203は、2
進データに変換された情報から、命令コード(rrr)
により指定されたレジスタがどのレジスタであるかを示
す情報であるアドレス用レジスタ選択信号をアドレス用
レジスタ選択信号線137を介して出力する。
The address register selection circuit 203
From the information converted to binary data, the instruction code (rrr)
A register selection signal for address, which is information indicating which register is designated by (1), is output via an address register selection signal line 137.

【0061】転送用レジスタ選択回路204は、2進デ
ータに変換された情報から、命令コード(RRR)によ
り指定されたレジスタがどのレジスタであるかを示す情
報である転送用レジスタ選択信号を転送用レジスタ選択
信号線138を介して出力する。
The transfer register selection circuit 204 transfers a transfer register selection signal, which is information indicating which register is specified by the instruction code (RRR), from the information converted into binary data. Output via the register selection signal line 138.

【0062】命令コードの4ビット目が“1”の時4ビ
ット目のANDゲート202はロード命令選択信号線1
35をアクティブにする。
When the fourth bit of the instruction code is “1”, the AND gate 202 of the fourth bit is set to the load instruction selection signal line 1
Activate 35.

【0063】命令コードの5ビット目が“1”の時5ビ
ット目のANDゲート202はストア命令選択信号線1
36をアクティブにする。
When the fifth bit of the instruction code is “1”, the fifth-bit AND gate 202 is connected to the store instruction selection signal line 1
Activate 36.

【0064】XORゲート205は、命令コードの4ビ
ット目(ロード命令)および5ビット目(ストア命令)
のうちの一方が“1”の時デコード処理制御信号線13
9をアクティブにする。
The XOR gate 205 stores the fourth bit (load instruction) and the fifth bit (store instruction) of the instruction code.
When one of them is "1", the decode processing control signal line 13
Activate 9

【0065】命令コードの9ビット目〜16ビット目は
アドレスディスプレースメントデータとして信号線13
3を介して出力される。
The ninth to sixteenth bits of the instruction code are used as address displacement data on the signal line 13.
3 is output.

【0066】ANDゲート202群は、信号線145を
介して与えられるイベントイネーブル信号により命令の
デコード結果である2進数の命令コード206を出力す
るか否かを制御する。
The group of AND gates 202 controls whether or not to output a binary instruction code 206, which is a result of decoding an instruction, according to an event enable signal provided via a signal line 145.

【0067】アクセスアドレス生成部132は、その構
成を示した図4を参照すると、データ長拡張用シフタ3
01とアドレス加算器302とを含んでいる。
Referring to FIG. 4 showing the configuration, access address generating section 132 includes data length extension shifter 3.
01 and an address adder 302.

【0068】データ長拡張用シフタ301は、その構成
を示した図5を参照すると、バス137上の命令コード
のうち9ビット目〜16ビット目のアドレスディスプレ
ースメントデータをアドレス生成に必要なデータに変換
するために、アドレスディスプレースメントデータのビ
ット幅の符号拡張、ここではさらに8ビット分の信号線
401の拡張を行いバス303に16ビットの拡張後ア
ドレスディスプレースメントデータとして出力する。
Referring to FIG. 5 showing the configuration, data length extension shifter 301 converts the ninth to sixteenth bit address displacement data of the instruction code on bus 137 into data necessary for address generation. In order to perform the conversion, the sign displacement of the bit width of the address displacement data is extended, here, the signal line 401 for 8 bits is further extended, and output to the bus 303 as 16-bit extended address displacement data.

【0069】アドレス加算器302は、信号線137の
アドレス用レジスタ選択信号に応答して、バス303上
の変換されたディスプレースメントデータである拡張後
ディスプレースメントデータと、バス161上のレジス
タ間接アドレッシングのためのレジスタデータとを加算
することによって、実際にアクセス対象となるアクセス
アドレスを算出しバス134に出力する処理を行う。
The address adder 302 responds to the address register selection signal on the signal line 137, and outputs the expanded displacement data, which is the converted displacement data on the bus 303, and the register indirect addressing on the bus 161. Then, a process of calculating an access address to be actually accessed and outputting the calculated address to the bus 134 is performed.

【0070】イベント処理部105は、イベントアドレ
スレジスタ141と、アドレスコンパレータ142とを
含んでいる。
The event processing unit 105 includes an event address register 141 and an address comparator 142.

【0071】イベントアドレスレジスタ141は、イベ
ント検出したい条件のうち、アドレスに関する情報を設
定する格納領域であり、外部のイベント管理領域にイベ
ントデータバス171を介して接続されている。
The event address register 141 is a storage area for setting information on an address among conditions to be detected for an event, and is connected to an external event management area via an event data bus 171.

【0072】また、イベントアドレスレジスタ141
は、外部のイベント管理領域から情報が送られるとイベ
ントイネーブル信号をイベントイネーブル信号線145
に出力する。なお、外部のイベント管理領域は本発明と
直接関係しないため、ここでの説明は省略する。
The event address register 141
When information is sent from an external event management area, an event enable signal is sent to the event enable signal line 145.
Output to Since the external event management area is not directly related to the present invention, the description is omitted here.

【0073】アドレスコンパレータ142は、その構成
を示した図6を参照すると、2入力の比較器でイベント
アドレスレジスタ141からバス143に出力されたイ
ベントアドレスと、アクセスアドレス生成部132から
バス143に出力されたアクセスアドレス134とをコ
ンパレータ501により比較し、一致していればアドレ
ス一致検出信号を信号線144に出力する。
Referring to FIG. 6 showing the structure of the address comparator 142, the event address output from the event address register 141 to the bus 143 by the two-input comparator and the output from the access address generator 132 to the bus 143 are shown. The comparator 501 compares the obtained access address 134 with the access address 134, and outputs an address match detection signal to the signal line 144 if they match.

【0074】また、コンパレータ501には、信号線1
35から入力するロード命令選択信号と、信号線136
から入力するストア命令選択信号がXORゲート502
に入力されている。XORゲート502は、入力された
前述の信号のうち、どちらか一方が有効の場合にコンパ
レータイネーブル信号を信号線503を介してコンパレ
ータ501に出力する。この場合の有効は、XORゲー
ト502に入力される論理値が“1”を指す。
The comparator 501 has a signal line 1
35, a load instruction selection signal input from the
A store instruction selection signal input from the XOR gate 502
Has been entered. The XOR gate 502 outputs a comparator enable signal to the comparator 501 via the signal line 503 when one of the input signals is valid. The valid state in this case indicates that the logical value input to the XOR gate 502 is “1”.

【0075】内部レジスタ部107は、CPUのリソー
スであるレジスタに割り当てられた格納領域であり、内
部デバッグ用データバス173にレジスタデータバス1
61を介して接続されている。
The internal register section 107 is a storage area allocated to a register which is a resource of the CPU.
61 are connected.

【0076】次に、第1の実施形態の動作を、図1から
図7並びに動作説明用のタイミングチャートを示した図
8および図9をそれぞれ参照しながら説明する。
Next, the operation of the first embodiment will be described with reference to FIGS. 1 to 7 and FIGS. 8 and 9 showing timing charts for explaining the operation.

【0077】まず図1を参照すると、デバッグ用CPU
101は命令を実行するために、まず、命令フェッチ部
102にあるバスインタフェース111がフェッチバス
172を介して命令コードを命令キュー112に順次、
格納していく。
First, referring to FIG. 1, a debugging CPU
In order to execute an instruction, first, a bus interface 111 in the instruction fetch unit 102 sequentially stores an instruction code in an instruction queue 112 via a fetch bus 172.
Store.

【0078】続いて、命令デコード部103にある命令
デコーダ121およびイベント用命令デコード部104
にあるロード/ストア命令コード解析部131には、命
令キュー112から出力された命令コードがバス114
を介して双方に入力され、それぞれにおいて命令コード
が解析される。
Subsequently, the instruction decoder 121 and the event instruction decoder 104 in the instruction decoder 103 are provided.
The instruction code output from the instruction queue 112 is stored in a load 114
And the instruction code is analyzed in each case.

【0079】ここで、図2を参照しながら命令デコーダ
121と本発明のロード/ストア命令コード解析部13
1とを対比しながら、ロード/ストア命令コード解析部
131の動作を説明する。
Here, the instruction decoder 121 and the load / store instruction code analyzer 13 of the present invention will be described with reference to FIG.
The operation of the load / store instruction code analysis unit 131 will be described in comparison with 1.

【0080】バス114から命令コードが入力された命
令デコーダ121およびロード/ストア命令コード解析
部131は、まず、命令コードを16進データから2進
データに変換する。
The instruction decoder 121 and the load / store instruction code analyzer 131 to which the instruction code has been input from the bus 114 first convert the instruction code from hexadecimal data to binary data.

【0081】これは、命令コードをビットごとのデータ
として扱えるようにするためであり、命令コードの形式
からこのような処理が行われる。命令デコーダ121で
はデバッグ用CPU101がサポートする全ての命令を
対象としているが、ロード/ストア命令コード解析部1
31では、命令のニーモニックを示す2進データを使用
してロードもしくはストア命令だけを対象とするため、
対象となっているロードもしくはストア命令を判断する
時間は回路規模の関係から短縮できる。
This is because the instruction code can be handled as data for each bit, and such processing is performed from the format of the instruction code. The instruction decoder 121 targets all instructions supported by the debug CPU 101, but the load / store instruction code analyzer 1
At 31, since only the load or store instruction is targeted using binary data indicating the mnemonic of the instruction,
The time for determining the target load or store instruction can be reduced due to the circuit size.

【0082】ロードもしくはストア命令であることが判
断された後、ロード/ストア命令コード解析部131
は、命令デコーダ121に対して、デコード処理制御信
号を信号線139を介して出力し、命令デコーダ121
の処理を停止させる。
After it is determined that the instruction is a load or store instruction, the load / store instruction code analyzing unit 131
Outputs a decode control signal to the instruction decoder 121 via a signal line 139,
Stop the processing of.

【0083】また、命令デコーダ121の処理を停止さ
せる理由として、対象としている命令がロードもしくは
ストア命令であることが挙げられる。これらの命令は、
メモリアクセスを伴う命令であるので対象となるメモリ
アドレスを決定しておかなくてはならない。
The reason why the processing of the instruction decoder 121 is stopped is that the target instruction is a load or store instruction. These instructions are
Since the instruction involves a memory access, the target memory address must be determined.

【0084】この時に必要になるのはレジスタの値であ
る。ロードもしくはストア命令のアドレッシングがレジ
スタ間接アドレッシングである場合、命令コードに含ま
れるディスプレースメントとレジスタの値でアクセス対
象となるアドレスが決定される。
At this time, the value of the register is required. When the addressing of the load or store instruction is the register indirect addressing, the address to be accessed is determined by the displacement and the register value included in the instruction code.

【0085】このアドレスの決定に必要なレジスタの値
は、現在処理中の命令の直前に実行される命令が終了す
るまで確定しない可能性がある。そのために、命令デコ
ーダ121の処理を停止させて、直前の命令が実行され
るまでの間待つ必要がある。
The value of the register required for determining the address may not be determined until the instruction executed immediately before the instruction currently being processed ends. Therefore, it is necessary to stop the processing of the instruction decoder 121 and wait until the immediately preceding instruction is executed.

【0086】再び図1を参照すると、ロード/ストア命
令コード解析部131は、命令コードからレジスタの値
が確定するとアクセスの対象となるアドレスを決定する
ことができるので、アクセスアドレス生成部132に対
してレジスタ選択信号、つまりアドレス用レジスタ選択
信号および転送用レジスタ選択信号をそれぞれ信号線1
37および138を介して出力し、さらにアドレスディ
スプレースメントデータをバス133を介して出力す
る。
Referring again to FIG. 1, the load / store instruction code analysis unit 131 can determine the address to be accessed when the register value is determined from the instruction code. And a register selection signal, that is, a register selection signal for address and a register selection signal for transfer,
37 and 138, and the address displacement data via bus 133.

【0087】また、イベント処理部105にあるアドレ
スコンパレータ142に対して、ロード命令選択信号お
よびストア命令選択信号をそれぞれ信号線135および
136を介して出力する。これらの信号は、イベント検
出の処理を行ってよいかどうかの判断に使用される。
The load instruction select signal and the store instruction select signal are output to the address comparator 142 in the event processing section 105 via signal lines 135 and 136, respectively. These signals are used to determine whether the event detection processing can be performed.

【0088】一方、ロード/ストア命令コード解析部1
31からのアドレス用レジスタ選択信号、転送用レジス
タ選択信号およびアドレスディスプレースメントデータ
が入力されたアクセスアドレス生成部132は、アクセ
スアドレスを算出し信号線134を介してアドレスコン
パレータ142へ出力するための処理を行う。
On the other hand, load / store instruction code analyzer 1
The access address generation unit 132, to which the address register selection signal, the transfer register selection signal, and the address displacement data from 31 have been input, calculates the access address and outputs it to the address comparator 142 via the signal line 134. I do.

【0089】ここで、図4、図5を参照しながらアクセ
スアドレス生成部132の動作を説明する。まず、デー
タ長拡張用シフタ301により、レジスタ間接アドレッ
シングに必要なアドレスディスプレースメントデータを
符号拡張(図4の8ビットの信号線401)する。これ
はレジスタとの加算のため、符号ビットを使用してレジ
スタのビット幅、例えば16ビット幅に合わせている。
Here, the operation of the access address generator 132 will be described with reference to FIGS. First, the address displacement data required for register indirect addressing is sign-extended (8-bit signal line 401 in FIG. 4) by the data length extension shifter 301. This uses a sign bit to match the register bit width, for example, a 16-bit width, for addition with a register.

【0090】次に、符号拡張されて信号線303に出力
される拡張後アドレスディスプレースメントデータはア
ドレス加算器302に入力され、信号線137のアドレ
ス用レジスタ選択信号がアクティブ状態の時に信号線1
61のレジスタデータと加算される。
Next, the extended address displacement data, which is sign-extended and output to the signal line 303, is input to the address adder 302, and when the address register selection signal on the signal line 137 is active, the signal line 1
It is added to the register data of 61.

【0091】さらに、図6、図7を参照しながらアドレ
スコンパレータ142の動作を説明する。まず、信号線
135のロード命令選択信号および信号線136のスト
ア命令選択信号のいずれかがアクティブの時“1”レベ
ルとなるXORゲート502の出力信号であるコンパレ
ータイネーブル信号に応答して、アドレスコンパレータ
501の比較器601は、信号線143のイベントアド
レスレジスタ出力と信号線134のアクセスアドレスと
をビットごとにそれぞれ比較する。
Further, the operation of the address comparator 142 will be described with reference to FIGS. First, in response to a comparator enable signal, which is an output signal of the XOR gate 502, which becomes "1" level when one of the load instruction selection signal of the signal line 135 and the store instruction selection signal of the signal line 136 is active, the address comparator The comparator 601 compares the output of the event address register of the signal line 143 with the access address of the signal line 134 for each bit.

【0092】比較したビットごとのデータが全て“1”
で一致した場合には、ANDゲート602はアドレス一
致検出信号を信号線144に出力し、イベント検出に必
要なブロックに対してイベントが検出されたことを知ら
せる。
All data for each bit compared are "1".
If they match, the AND gate 602 outputs an address match detection signal to the signal line 144 to notify the block necessary for event detection that an event has been detected.

【0093】本実施形態ではイベントをブレークに使用
した場合に適用しているので、アドレス一致検出信号を
信号線144を介して命令実行部106にある割り込み
処理部152に対して入力し、実行ユニット151を停
止させる準備を行う。ここで用いたブレークとは、デバ
ッグ用CPU101が持つ専用の割り込みを使用し、実
行中のプログラムを中断する動作を表している。
Since the present embodiment is applied to the case where an event is used for a break, an address match detection signal is input to the interrupt processing unit 152 in the instruction execution unit 106 via the signal line 144, and the execution unit Prepare to stop 151. The break used here indicates an operation of interrupting the program being executed by using a dedicated interrupt of the debugging CPU 101.

【0094】ここで、フェッチした命令のデコードから
イベントのアドレス一致検出までの手順を図8に示すタ
イミングチャートを参照しながら説明する。この図8の
タイミングチャートは、パイプラインを使用したデバッ
グ用CPU101の処理をクロック801Aごとに表し
たものであり、第1の命令802Aはレジスタに対する
算術演算命令の実行タイミングである。
Here, a procedure from decoding of the fetched instruction to detection of an address match of the event will be described with reference to a timing chart shown in FIG. The timing chart of FIG. 8 shows the processing of the debugging CPU 101 using the pipeline for each clock 801A, and a first instruction 802A is an execution timing of an arithmetic operation instruction for a register.

【0095】第1の命令802Aが命令デコードステー
ジ(ID)まで処理する間に、第2の命令803Aであ
るロード命令は命令フェッチステージ(IF)まで処理
されている。
While the first instruction 802A processes up to the instruction decode stage (ID), the load instruction as the second instruction 803A is processed up to the instruction fetch stage (IF).

【0096】このとき、第1の命令802Aと第2の命
令803Aであるロード命令は同一のレジスタが使用さ
れる場合を想定しているので、第2の命令803Aであ
るロード命令は2クロック分のアイドル状態になる。こ
れが、第1の命令の結果を待つ区間805Aである。こ
の間に第1の命令802Aは命令実行ステージ(EX)
およびメモリアクセスステージ(MEM)まで処理を実
行している。
At this time, since the first instruction 802A and the load instruction as the second instruction 803A are assumed to use the same register, the load instruction as the second instruction 803A is equivalent to two clocks. It becomes idle state. This is the section 805A waiting for the result of the first instruction. During this time, the first instruction 802A is in the instruction execution stage (EX)
And processing up to the memory access stage (MEM).

【0097】このアイドル状態が終了すると、第1の命
令802Aはライトバックステージ(WB)を実行する
とともに、第2の命令803Aであるロード命令はイベ
ント用命令デコード部104が処理する命令デコードス
テージ(ID2)でデコードされて、ロード/ストア命
令コード解析部131はデコード処理制御信号を信号線
139を介して命令デコーダ121に出力する。
When the idle state ends, the first instruction 802A executes a write-back stage (WB), and the load instruction, which is the second instruction 803A, is an instruction decode stage ( The load / store instruction code analysis unit 131 outputs a decode processing control signal to the instruction decoder 121 via the signal line 139.

【0098】この時点で、第2の命令803Aであるロ
ード命令が使用するレジスタの値は確定しているので、
信号線134のアクセスアドレスの算出とアドレスコン
パレータ142による一致検出が行われている。
At this point, since the value of the register used by the load instruction as the second instruction 803A has been determined,
The calculation of the access address of the signal line 134 and the coincidence detection by the address comparator 142 are performed.

【0099】このタイミングで第3の命令804Aであ
る算術演算命令は命令フェッチステージ(IF)を終了
した段階で停止され、パイプラインは2クロック分のア
イドル状態になる。これが、第2の命令の結果を待つ区
間806Aである。このアイドル状態は第2の命令80
3Aであるロード命令が終了するまでの時間を確保する
ためのものである。このとき第2の命令803Aは命令
実行ステージ(EX)およびメモリアクセスステージ
(MEM)まで処理を実行している。
At this timing, the arithmetic operation instruction, which is the third instruction 804A, is stopped when the instruction fetch stage (IF) has been completed, and the pipeline enters an idle state for two clocks. This is the section 806A waiting for the result of the second instruction. This idle state is the second instruction 80
This is to secure time until the load instruction of 3A is completed. At this time, the second instruction 803A is executing processing up to the instruction execution stage (EX) and the memory access stage (MEM).

【0100】この間に、アドレスコンパレータ142か
らアドレス一致検出信号が信号線144を介して命令実
行部106にある割り込み処理部152に出力され、割
り込み処理部152から実行ユニット151に割り込み
信号が出力されるので、実行ユニット151にある第3
の命令804Aの算術演算命令にり込みがかかり、第3
の命令804Aは命令デコードステージ(ID)が終了
した時点で停止し、以降のステージは無効となる。
During this time, an address match detection signal is output from the address comparator 142 to the interrupt processing unit 152 in the instruction execution unit 106 via the signal line 144, and an interrupt signal is output from the interrupt processing unit 152 to the execution unit 151. Therefore, the third unit in the execution unit 151
Of the arithmetic operation instruction of the instruction 804A of FIG.
Instruction 804A stops when the instruction decode stage (ID) ends, and the subsequent stages become invalid.

【0101】上述した動作により、本実施形態で対象と
なった第2の命令803Aであるロード命令を実行直後
に、後続する第3の命令804Aは停止したことにな
る。
By the operation described above, immediately after executing the load instruction which is the second instruction 803A targeted in the present embodiment, the subsequent third instruction 804A is stopped.

【0102】続けて、フェッチした命令のデコードから
アドレス一致検出までの手順を図9のタイミングチャー
トを参照しながら説明する。図9は第2の命令がストア
命令の場合であり、図8同様にパイプラインを使用した
デバッグ用CPU101の処理をクロック801Bごと
に表したもので、第1の命令802Bはレジスタに対す
る算術演算命令の実行タイミングである。第1の命令8
02Bが命令デコードステージ(ID)まで処理する間
に、第2の命令803Bであるストア命令は命令フェッ
チステージ(IF)まで処理されている。
Next, a procedure from decoding of a fetched instruction to detection of an address match will be described with reference to a timing chart of FIG. FIG. 9 shows the case where the second instruction is a store instruction, and shows the processing of the debug CPU 101 using the pipeline for each clock 801B as in FIG. 8, and the first instruction 802B is an arithmetic operation instruction for a register. Is the execution timing. First instruction 8
While 02B processes up to the instruction decode stage (ID), the store instruction that is the second instruction 803B is processed up to the instruction fetch stage (IF).

【0103】このとき、第1の命令802Bと第2の命
令803Bであるストア命令は同一のレジスタが使用さ
れる場合を想定しているので、ここでも第2の命令80
3Bであるストア命令は2クロック分のアイドル状態に
なる。これが、第1の命令の結果を待つ区間805Bで
ある。
At this time, the first instruction 802B and the second instruction 803B are assumed to use the same register for the store instruction.
The 3B store instruction is in an idle state for two clocks. This is the section 805B waiting for the result of the first instruction.

【0104】このアイドル状態が終了すると、第2の命
令803Bのストア命令はイベント用命令デコード部1
04が処理する命令デコードステージ(ID2)でデコ
ードされている。このデコード結果を受けて、ロード/
ストア命令コード解析部131はデコード処理制御信号
を信号線139を介して命令デコーダ121に出力す
る。
When this idle state ends, the store instruction of the second instruction 803B is changed to the instruction decode unit 1 for the event.
04 is decoded in the instruction decode stage (ID2) which is processed. In response to this decoding result, load /
The store instruction code analysis unit 131 outputs a decode processing control signal to the instruction decoder 121 via the signal line 139.

【0105】この時点で、第2の命令803Bのストア
命令が使用するレジスタの値は確定しているので、アク
セスアドレス134の算出とアドレスコンパレータ14
2による一致検出が行われている。
At this point, the value of the register used by the store instruction of the second instruction 803B has been determined.
2 is performed.

【0106】このタイミング、すなわち、ロード/スト
ア命令コード解析部131のデコード処理制御信号によ
り第3の命令804Bの算術演算命令は、命令フェッチ
ステージ(IF)を終了した段階で停止され、パイプラ
インは2クロック分のアイドル状態になる。これが、第
2の命令の結果を待つ区間806Bであり、第2の命令
803Bのストア命令が終了するまでの時間を確保す
る。
At this timing, that is, the arithmetic operation instruction of the third instruction 804B is stopped by the decode processing control signal of the load / store instruction code analysis unit 131 at the stage when the instruction fetch stage (IF) is completed, and the pipeline is stopped. It becomes idle state for two clocks. This is the section 806B that waits for the result of the second instruction, and secures the time until the store instruction of the second instruction 803B ends.

【0107】この間に、アドレス一致検出信号144が
命令実行部106にある割り込み処理部152に出力さ
れ、第3の命令804Bは命令デコードステージ(I
D)が終了した時点で停止し、以降のステージは無効と
なる。
During this time, the address match detection signal 144 is output to the interrupt processing unit 152 in the instruction execution unit 106, and the third instruction 804B is set to the instruction decode stage (I
When D) ends, the operation stops, and the subsequent stages become invalid.

【0108】上述した動作により、本実施形態で対象と
なった第2の命令803Bのストア命令の実行直後に、
後続する第3の命令が停止したことになる。
By the above-described operation, immediately after the execution of the store instruction of the second instruction 803B targeted in the present embodiment,
The subsequent third instruction has stopped.

【0109】一方、図9においてアドレス一致が検出さ
れなかった場合の動作を図10に示すタイミングチャー
トを参照しながら説明する。図10はパイプラインを使
用したデバッグ用CPU101の処理をクロック801
Cごとに表したもので、ここでも第1の命令802Cは
レジスタに対する算術演算命令の実行タイミングである
とする。
On the other hand, the operation when no address match is detected in FIG. 9 will be described with reference to the timing chart shown in FIG. FIG. 10 shows the processing of the debug CPU 101 using the pipeline as the clock 801.
The first instruction 802C is also an execution timing of an arithmetic operation instruction for a register.

【0110】第1の命令802Cが命令デコードステー
ジ(ID)まで処理する間に、第2の命令803Cであ
るストア命令は命令フェッチステージ(IF)まで処理
されている。このとき、第1の命令802Cと第2の命
令803Cのストア命令は同一のレジスタが使用される
場合を想定しているので、第2の命令803Cのストア
命令は2クロック分のアイドル状態、すなわち、第1の
命令の結果を待つ区間805Cである。
While the first instruction 802C processes up to the instruction decode stage (ID), the store instruction as the second instruction 803C is processed up to the instruction fetch stage (IF). At this time, since the store instruction of the first instruction 802C and the store instruction of the second instruction 803C are assumed to use the same register, the store instruction of the second instruction 803C is in an idle state for two clocks, that is, , Section 805C waiting for the result of the first instruction.

【0111】このアイドル状態が終了すると、第2の命
令803Cのストア命令はイベント用命令デコード部1
04が処理する命令デコードステージ(ID2)でデコ
ードされて、ロード/ストア命令コード解析部131は
デコード処理制御信号を信号線139を介して命令デコ
ーダ121に出力する。
When this idle state ends, the store instruction of the second instruction 803C is changed to the instruction decode unit 1 for the event.
The instruction is decoded in the instruction decode stage (ID2) processed by the 04, and the load / store instruction code analyzer 131 outputs a decode processing control signal to the instruction decoder 121 via the signal line 139.

【0112】この時点で、第2の命令803Cのストア
命令が使用するレジスタの値は確定しているので、アク
セスアドレス134の算出とアドレスコンパレータ14
2による一致検出が行われている。
At this point, the value of the register used by the store instruction of the second instruction 803C has been determined.
2 is performed.

【0113】このタイミングで、デコード処理制御信号
に応答して第3の命令804Cの算術演算命令は命令フ
ェッチステージ(IF)を終了した段階で停止され、パ
イプラインは2クロック分のアイドル状態になる。
At this timing, in response to the decode processing control signal, the arithmetic operation instruction of the third instruction 804C is stopped when the instruction fetch stage (IF) is completed, and the pipeline enters an idle state for two clocks. .

【0114】これが、第2の命令の結果を待つ区間80
6Cであり、第2の命令803Cのストア命令が終了す
るまでの時間を確保する。
This is the interval 80 for waiting for the result of the second instruction.
6C, which secures a time until the store instruction of the second instruction 803C ends.

【0115】ここでは、信号線134のアクセスアドレ
スが、信号線143のイベントアドレスレジスタ出力と
一致しなかったため、アドレス一致検出信号は非アクテ
ィブで信号線144のレベルが“0”のままになるの
で、割り込み処理部は割り込み信号153を出力しな
い。
Here, since the access address of the signal line 134 does not match the output of the event address register of the signal line 143, the address match detection signal is inactive and the level of the signal line 144 remains "0". , The interrupt processing unit does not output the interrupt signal 153.

【0116】したがって、第3の命令804Cの算術演
算命令は命令デコードステージ(ID)以降のステージ
も実行されることになる。
Therefore, the arithmetic operation instruction of the third instruction 804C is also executed in the stages after the instruction decode stage (ID).

【0117】なお、チップレイアウトとしては、イベン
ト用命令デコード部104を命令デコード部103に隣
接させて配置することが望ましい。つまり、命令キュー
112の出力を配線114を介して命令デコード部10
3およびイベント用命令デコード部104に配線すると
きの配線遅延を極力減らすためである。
As a chip layout, it is desirable to arrange the event instruction decoding unit 104 adjacent to the instruction decoding unit 103. That is, the output of the instruction queue 112 is transmitted via the wiring 114 to the instruction decoding unit 10.
This is for minimizing the wiring delay when wiring to the instruction decoding unit 104 for event No. 3 and the event.

【0118】上述した第1の実施形態によれば、メモリ
に対するアクセスが行われる命令、例えばロード命令、
ストア命令の場合でも、対象となるメモリアクセスのア
ドレスを命令デコード部103の命令デコードステージ
(ID1)と同様のタイミングで算出することで、メモ
リに対するアクセスが行われる命令の実行完了直後に、
メモリアクセスイベントの対象となった命令(上述の例
における第3の命令)の実行ステージ以降を停止させる
ことができることになる。
According to the first embodiment described above, an instruction for accessing a memory, for example, a load instruction,
Even in the case of a store instruction, by calculating the address of the target memory access at the same timing as the instruction decode stage (ID1) of the instruction decode unit 103, immediately after the execution of the instruction for accessing the memory is completed,
Thus, it is possible to stop the execution stage of the instruction (the third instruction in the above-described example) that is the target of the memory access event and thereafter.

【0119】その理由として、パイプラインのアイドル
状態を利用していることが挙げられる。つまり、パイプ
ラインの動作をアイドル状態にすることで命令実行ステ
ージを遅らせて、次の命令実行を無効にできるからであ
る。
The reason is that the idle state of the pipeline is used. That is, by setting the operation of the pipeline to the idle state, the instruction execution stage can be delayed and the next instruction execution can be invalidated.

【0120】例えば、日本電気社製のシングルチップマ
イクロコンピュータV850ファミリで考えると、CP
Uクロックが66MHzであれば遅らせる時間は次式の
ようになる。
For example, considering the single-chip microcomputer V850 family manufactured by NEC Corporation, CP
If the U clock is 66 MHz, the delay time is as follows.

【0121】 1/66[uS/クロック]×1〜2[クロック] =1.51〜3.02[uS]‥‥‥‥‥‥‥‥‥‥‥‥‥‥(1) すなわち、式(1)で示す時間の命令実行のリアルタイ
ム性は損なわれるが、メモリアクセスイベント検出の時
間差が生じる従来技術に比べて、メモリアクセスイベン
トの対象となった命令がデコードステージ実行後に停止
する本実施例では、1〜2命令分の命令の実行を防止で
きる。
1/66 [uS / clock] × 1-2 [clock] = 1.51-3.02 [uS] ‥‥‥‥‥‥‥‥‥‥‥‥‥‥ (1) That is, the expression ( Although the real-time property of the instruction execution at the time indicated by 1) is impaired, the present embodiment in which the instruction targeted for the memory access event stops after the execution of the decode stage, as compared with the related art in which the time difference of the memory access event detection occurs. , 1-2 instructions can be prevented from being executed.

【0122】これをデバッグ装置を使用する操作者に当
てはめると、デバッガ操作者がイベントを設定し、プロ
グラムの実行を繰り返し、プログラムの停止位置をさか
のぼって確認する作業を想定すると、操作者が確認に要
する時間は、 デバッグ装置を使用したイベント設定‥‥‥‥‥‥‥‥‥‥‥‥‥‥‥状態1 プログラムの停止位置から命令コードをさかのぼっての命令確認‥‥‥状態2 とすると、例えば、状態1=300回、状態2=12
[S]であれば、 300回×12[S]=3600[S]‥‥‥‥‥‥‥‥‥‥‥‥‥(2) というこになる。
When this is applied to the operator using the debugging device, assuming that the debugger operator sets an event, repeats the execution of the program, and confirms the stop position of the program, the operator confirms the operation. The time required is as follows: Event setting using the debugger {State 1 Instruction confirmation from instruction position from program stop position} State 2 , State 1 = 300 times, state 2 = 12
In the case of [S], 300 times × 12 [S] = 3600 [S] ‥‥‥‥‥‥‥‥‥‥‥‥‥ (2).

【0123】式(2)の時間の作業を考えても、効果は
大きいと言える。
The effect can be said to be great even when considering the work of the time of Expression (2).

【0124】次に、本発明の第2の実施形態を説明す
る。
Next, a second embodiment of the present invention will be described.

【0125】第2の実施形態の構成を示した図11を参
照すると、イベントを使用するユニットの一つであるト
レース部108がデバッグ用CPU101の外部に、イ
ベントデータバス171と、外部アドレスバス174
と、外部データバス175と、アドレス一致検出信号1
44とを接続して、設けられている。
Referring to FIG. 11 showing the configuration of the second embodiment, the trace unit 108, which is one of the units using an event, is provided outside the debug CPU 101 with an event data bus 171 and an external address bus 174.
, External data bus 175 and address match detection signal 1
44 and is provided.

【0126】トレース部108は、アドレス一致検出信
号を信号線144を介して入力し、トレースの開始、終
了を制御するトレースイベント制御部701と、プログ
ラム実行の経過が書き込まれるトレースメモリ702と
を含んでいる。
The trace section 108 receives an address match detection signal via a signal line 144, and includes a trace event control section 701 for controlling the start and end of a trace, and a trace memory 702 for writing the progress of program execution. In.

【0127】トレースイベント制御部701は、イベン
トデータバス171に入力端が接続されるトレースイベ
ント比較部703と、トレースイベント比較部703の
出力線およびアドレス一致検出信号線141が入力端に
接続され、その出力端がライトイネーブル信号線703
に接続されるANDゲート704とを含んでいる。
The trace event control section 701 has a trace event comparison section 703 whose input terminal is connected to the event data bus 171, an output line of the trace event comparison section 703 and an address match detection signal line 141 connected to the input terminal, Its output terminal is a write enable signal line 703.
Connected to an AND gate 704.

【0128】この回路の動作は、イベント処理部105
にあるアドレスコンパレータ142の出力であるアドレ
ス一致検出信号を受けたトレースイベント制御部701
は、トレースメモリ702に対してライトイネーブル信
号を信号線903を介して出力し、トレースメモリ90
2への書き込みを制御する。
The operation of this circuit is determined by the event processing unit 105
Trace event control unit 701 receiving an address match detection signal output from the address comparator 142
Outputs a write enable signal to the trace memory 702 via a signal line 903,
2 is controlled.

【0129】つまり、イベントデータバス141から
“トレースイベントにイベントが関連付けられた”こと
を示すデータをトレースイベント比較部703が受け取
ると、トレースイベント比較部703はANDゲート7
04に“1”を出力し、アドレス一致信号によりトレー
スメモリ702へライトイネーブル信号が出力できるよ
うにする。これにより、アドレス一致信号が有効になっ
た時点で、トレースができるようになる。
That is, when the trace event comparison unit 703 receives data indicating that “an event is associated with a trace event” from the event data bus 141, the trace event comparison unit 703
04 is output to enable a write enable signal to be output to the trace memory 702 by an address match signal. This enables tracing when the address match signal becomes valid.

【0130】ここでは、トレースメモリ702へ書き込
まれるタイミングが問題になる。すなわち、イベントの
対象となった命令が実行された直後にアドレス一致検出
信号が信号が出力されないとトレースメモリ702への
書き込み制御が遅れてしまい、必要なデータが書き込ま
れなかったり、不必要なデータが書き込まれてしまうと
いったことが起こる。
Here, the timing of writing to the trace memory 702 becomes a problem. That is, if the address match detection signal is not output immediately after the execution of the instruction targeted for the event, the write control to the trace memory 702 is delayed, so that necessary data is not written or unnecessary data is not written. Is written.

【0131】この第2の実施形態は、トレース機能に本
発明を適用したことにより、トレースメモリ702への
書き込みタイミングを調整できるので、さらに第1の実
施形態の動作を拡張することができる。
In the second embodiment, the timing of writing to the trace memory 702 can be adjusted by applying the present invention to the trace function, so that the operation of the first embodiment can be further extended.

【0132】次に本発明の第3の実施形態を説明する。Next, a third embodiment of the present invention will be described.

【0133】第3の実施形態の構成を示した図12を参
照すると、イベントを使用するユニットの一つであるタ
イマ部109がイベントデータバス171と、アドレス
一致検出信号線144とを接続して設けられている。
Referring to FIG. 12 showing the configuration of the third embodiment, a timer unit 109, which is one of the units using an event, connects an event data bus 171 and an address match detection signal line 144 to each other. Is provided.

【0134】このタイマ部はデバッグ用CPUに内蔵さ
れているタイマとは別に設けられるタイマカウンタであ
り、デバッグ用に使用され、主としてデバッグ対象プロ
グラムの実行時間を計測するためのものである。
This timer section is a timer counter provided separately from the timer built in the debug CPU, is used for debugging, and is mainly for measuring the execution time of the program to be debugged.

【0135】タイマ部109は、イベントを使用してタ
イマカウンタ802の開始、終了を制御するタイマイベ
ント制御部801と、イベントによってカウンと動作を
制御できるタイマカウンタ802とを含んでいる。
The timer unit 109 includes a timer event control unit 801 that controls the start and end of the timer counter 802 using an event, and a timer counter 802 that can control the count and operation by the event.

【0136】タイマイベント制御部801は、イベント
データバス171に入力端が接続されるタイマイベント
比較部803と、タイマイベント比較部803の出力線
およびアドレス一致検出信号線141が入力端に接続さ
れ、その出力端がカウンタスタート信号線806に接続
されるANDゲート804と、タイマイベント比較部8
03の出力線およびアドレス一致検出信号線141が入
力端に接続され、その出力端がカウンタストップ信号線
807に接続されるANDゲート805とを含んでい
る。
The timer event control section 801 has a timer event comparison section 803 whose input terminal is connected to the event data bus 171, an output line of the timer event comparison section 803 and an address match detection signal line 141 connected to the input terminal, An AND gate 804 whose output terminal is connected to the counter start signal line 806;
And an AND gate 805 whose output end is connected to the counter stop signal line 807.

【0137】この回路の動作は、イベント処理部105
にあるアドレスコンパレータ142の出力であるアドレ
ス一致検出信号をその信号線144を介して受けたタイ
マイベント制御部801は、タイマカウンタ802に対
してカウントスタート信号806、もしくはカウントス
トップ信号807とを出力し、タイマカウンタ802を
制御する。
The operation of this circuit is determined by the event processing unit 105
The timer event control unit 801 having received the address match detection signal output from the address comparator 142 through the signal line 144 outputs a count start signal 806 or a count stop signal 807 to the timer counter 802. , A timer counter 802.

【0138】つまり、イベントデータバス141から
“タイマイベントにイベントが関連付けられた”ことを
示すデータをタイマイベント比較部803が受け取る
と、タイマイベント比較部803はANDゲート804
に“1”を出力し、アドレス一致信号によりタイマカウ
ンタ802へのタイマスタート信号が出力できるように
する。
That is, when the timer event comparison unit 803 receives data indicating “the event is associated with the timer event” from the event data bus 141, the timer event comparison unit 803 sets the AND gate 804
"1" to output a timer start signal to the timer counter 802 in response to the address match signal.

【0139】一方、イベントデータバス141から“タ
イマイベントに対するイベントの関連付けが終わった”
ことを示すデータをタイマイベント比較部803が受け
取ると、タイマイベント比較部803はANDゲート8
05に“1”を出力し、アドレス一致信号によりタイマ
カウンタ802へタイマストップ信号が出力できるよう
にする。これにより、アドレス一致信号が有効になった
時点で、トレースができるようになる。
On the other hand, from the event data bus 141, "the association of the event with the timer event has been completed."
When the timer event comparing unit 803 receives the data indicating that the
05 is output to enable a timer stop signal to be output to the timer counter 802 by the address match signal. This enables tracing when the address match signal becomes valid.

【0140】ここでは、タイマのスタート、およびスト
ップのタイミングが問題になる。すなわち、イベントの
対象となった命令が実行された直後にアドレス一致検出
信号が信号線144に出力されないとタイマカウンタ8
02の制御が遅れてしまい、カウントする回数に誤差が
生じてしまう。
Here, the timing of the start and stop of the timer becomes a problem. That is, if the address match detection signal is not output to the signal line 144 immediately after the execution of the instruction targeted for the event, the timer counter 8
02 is delayed, and an error occurs in the number of times of counting.

【0141】この実施形態は、タイマ機能に本発明を適
用したことにより、タイマカウンタ802の開始、終了
タイミングを調整できるので、さらに第1の実施形態の
動作を拡張することができる。
In this embodiment, since the start and end timings of the timer counter 802 can be adjusted by applying the present invention to the timer function, the operation of the first embodiment can be further extended.

【0142】[0142]

【発明の効果】上述したように、本発明のデバッグ用C
PUに内蔵のイベント検出回路は、命令フェッチステー
ジで読み込んだ命令をデコードする命令デコード手段の
ほかに、読み込んだ命令からロード命令およびストア命
令を抽出し後続する次命令のデコードを予め定める期間
停止させる命令コード解析手段および読み込んだ命令の
アクセスアドレスを生成するアドレス生成手段からなる
イベント用命令デコード手段と、アクセスアドレスおよ
び予め設定したイベントアドレスが一致したとき命令実
行手段に割り込みをかけて後続する次命令の実行ステー
ジ以降の命令処理ステージを無効にするためのアドレス
一致信号を生成するイベント処理手段とを備えるので、
メモリに対するアクセスが行われる命令の場合でも、対
象となるメモリアクセスのアドレスを命令デコードステ
ージ(ID1)と同様のタイミングで算出することで、
メモリアクセスイベントの対象となった命令を実行直後
に停止させることができる。
As described above, the debugging C of the present invention is used.
An event detection circuit built in the PU extracts, in addition to the instruction decoding means for decoding the instruction read in the instruction fetch stage, a load instruction and a store instruction from the read instruction, and stops the decoding of the succeeding next instruction for a predetermined period. An instruction decoding means for an event comprising an instruction code analysis means and an address generation means for generating an access address of the read instruction; and a next instruction which interrupts the instruction execution means when the access address and the preset event address match, and then follows the next instruction And an event processing means for generating an address match signal for invalidating an instruction processing stage after the execution stage of
Even in the case of an instruction that accesses the memory, the address of the target memory access is calculated at the same timing as the instruction decode stage (ID1),
The instruction targeted for the memory access event can be stopped immediately after execution.

【0143】つまり、パイプラインのアイドル状態を利
用しているので、パイプラインの動作をアイドル状態に
することで命令実行ステージを遅らせて、次の命令実行
を無効にできる。
That is, since the idle state of the pipeline is used, the instruction execution stage can be delayed by setting the pipeline operation to the idle state, and the next instruction execution can be invalidated.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の第1の実施形態の構成図である。FIG. 1 is a configuration diagram of a first embodiment of the present invention.

【図2】ロード/ストア命令コード解析部131のブロ
ック図である。
FIG. 2 is a block diagram of a load / store instruction code analysis unit 131.

【図3】本実施形態で適用する命令コード形式を示す図
である。
FIG. 3 is a diagram showing an instruction code format applied in the present embodiment.

【図4】アクセスアドレス生成部132のブロック図で
ある。
FIG. 4 is a block diagram of an access address generation unit 132;

【図5】データ長拡張用シフタ301の構成図である。FIG. 5 is a configuration diagram of a data length extension shifter 301;

【図6】アドレスコンパレータ142のブロック図であ
る。
FIG. 6 is a block diagram of an address comparator 142.

【図7】コンパレータ501のブロック図である。FIG. 7 is a block diagram of a comparator 501.

【図8】第1の実施形態のロード命令実行時にアドレス
一致が検出されたときの動作説明用タイミングチャート
である。
FIG. 8 is a timing chart for explaining operation when an address match is detected during execution of a load instruction according to the first embodiment;

【図9】第1の実施形態のストア命令実行時にアドレス
一致が検出されたときの動作説明用タイミングチャート
である。
FIG. 9 is a timing chart for explaining the operation when an address match is detected during execution of a store instruction according to the first embodiment;

【図10】第1の実施形態のストア命令実行時にアドレ
ス一致が検出されないときの動作説明用タイミングチャ
ートである。
FIG. 10 is a timing chart for explaining operation when an address match is not detected during execution of a store instruction according to the first embodiment;

【図11】本発明の第2の実施形態の構成図である。FIG. 11 is a configuration diagram of a second embodiment of the present invention.

【図12】本発明の第3の実施形態の構成図である。FIG. 12 is a configuration diagram of a third embodiment of the present invention.

【図13】従来のイベント検出手段の一例を示す構成図
である。
FIG. 13 is a configuration diagram illustrating an example of a conventional event detection unit.

【図14】従来のイベント検出手段でロード命令実行時
にアドレス一致が検出されたときの動作説明用タイミン
グチャートである。
FIG. 14 is a timing chart for explaining the operation when an address match is detected during execution of a load instruction by a conventional event detection means.

【符号の説明】[Explanation of symbols]

101 デバッグ用CPU 102 命令フェッチ部 103 命令デコード部 104 イベント用命令デコード部 105 イベント処理部 106 命令実行部 107 内部レジスタ部 108 トレース部 109 タイマ部 111 バスインタフェース 112 命令キュー 121 命令デコーダ 131 ロード/ストア命令コード解析部 132 アクセスアドレス生成部 141 イベントアドレスレジスタ 142 アドレスコンパレータ 151 実行ユニット 152 割り込み処理部 201 デコーダ 202,602,704,804,805 ANDゲ
ート 203 アドレス用レジスタ選択回路 204 転送用レジスタ選択回路 205,502 XORゲート 301 データ長拡張用シフタ 302 アドレス加算器 501 コンパレータ 601 比較器 701 トレースイベント制御部 702 トレースメモリ 703 トレースイベント比較部 801 タイマイベント制御部 802 タイマカウンタ 803 タイマイベント比較部
Reference Signs List 101 debug CPU 102 instruction fetch unit 103 instruction decode unit 104 event instruction decode unit 105 event processing unit 106 instruction execution unit 107 internal register unit 108 trace unit 109 timer unit 111 bus interface 112 instruction queue 121 instruction decoder 131 load / store instruction Code analysis unit 132 Access address generation unit 141 Event address register 142 Address comparator 151 Execution unit 152 Interrupt processing unit 201 Decoder 202, 602, 704, 804, 805 AND gate 203 Address register selection circuit 204 Transfer register selection circuit 205, 502 XOR gate 301 Data length extension shifter 302 Address adder 501 Comparator 601 Comparator 701 Training Source event control unit 702 trace memory 703 trace event comparison unit 801 timer event control unit 802 timer counter 803 timer event comparison unit

Claims (16)

【特許請求の範囲】[Claims] 【請求項1】 開発対象プログラムのデバッグに用いる
開発支援装置のデバッグ用CPUに内蔵のイベント検出
回路において、命令フェッチステージで読み込んだ命令
をデコードする命令デコード手段のほかに、読み込んだ
前記命令からロード命令およびストア命令を抽出し後続
する次命令のデコードを予め定める期間停止させる命令
コード解析手段および読み込んだ前記命令のアクセスア
ドレスを生成するアクセスアドレス生成手段からなるイ
ベント用命令デコード手段と、前記アクセスアドレスお
よび予め設定したイベントアドレスが一致したとき命令
実行手段に割り込みをかけて前記後続命令の実行ステー
ジ以降の命令処理ステージを無効にするためのアドレス
一致信号を生成するイベント処理手段とを備えて構成す
ることを特徴とするデバッグ用CPUに内蔵のイベント
検出回路。
An event detection circuit built in a debugging CPU of a development support device used for debugging a development target program, in addition to an instruction decoding means for decoding an instruction read in an instruction fetch stage, a load from the read instruction. Instruction code analyzing means for extracting an instruction and a store instruction and stopping the decoding of the next following instruction for a predetermined period; and an instruction decoding means for an event comprising access address generating means for generating an access address of the read instruction; And event processing means for generating an address match signal for interrupting the instruction execution means when a preset event address matches and invalidating an instruction processing stage after the execution stage of the subsequent instruction. Characterized by Event detection circuit built into the CPU for debugging.
【請求項2】 前記命令コード解析手段は、前記ロード
命令もしくは前記ストア命令をデコードした場合はその
アドレス算出に必要なレジスタ値が確定するまで前記命
令デコーダの処理を停止させて待機するためのデコード
処理制御信号を生成する請求項1記載のデバッグ用CP
Uに内蔵のイベント検出回路。
2. The decoding device according to claim 1, wherein, when the load instruction or the store instruction is decoded, the instruction code analysis unit stops processing of the instruction decoder and waits until a register value necessary for calculating the address is determined. 2. The debug CP according to claim 1, wherein the process control signal is generated.
Event detection circuit built in U.
【請求項3】 前記イベント用命令デコード手段は、前
記ロード命令におけるメモリからのデータ読み出し動作
と前記デバッグ用CPUの内部レジスタへのデータ格納
動作とが完了したタイミングで、命令実行ステージ以降
の命令処理ステージの動作を停止させて後続命令の実行
を無効にする請求項1記載のデバッグ用CPUに内蔵の
イベント検出回路。
3. The event instruction decoding means according to claim 1, wherein at a timing when the data read operation from the memory in the load instruction and the data storage operation to the internal register of the debug CPU are completed, the instruction processing after the instruction execution stage. 2. The event detection circuit built in a debugging CPU according to claim 1, wherein the operation of the stage is stopped to disable execution of a subsequent instruction.
【請求項4】 前記イベント用命令デコード手段は、ス
トア命令におけるメモリへの書き込み動作が完了したタ
イミングで、前記命令実行ステージ以降の命令処理ステ
ージの動作を停止させて後続命令の実行を無効にする請
求項1記載のデバッグ用CPUに内蔵のイベント検出回
路。
4. The event instruction decoding means stops the operation of an instruction processing stage after the instruction execution stage at the timing when the write operation to the memory in the store instruction is completed, and invalidates the execution of the subsequent instruction. An event detection circuit built in the debug CPU according to claim 1.
【請求項5】 前記イベント用命令デコード手段は、直
前の命令のメモリアクセスステージが完了するまでデコ
ードステージ以降の命令処理ステージの動作を待機させ
るために前記ロード命令および前記ストア命令があらか
じめ有するアイドル期間に対応させて、前記アイドル期
間をもたない後続命令に対しても、前記ロード命令およ
び前記ストア命令のメモリアクセスステージが完了する
までデコードステージ以降の命令処理ステージの動作を
待機させるためのデコード停止期間設定用の制御信号を
生成する請求項1記載のデバッグ用CPUに内蔵のイベ
ント検出回路。
5. The idle instruction period included in the load instruction and the store instruction in order for the event instruction decoding means to wait for the operation of an instruction processing stage after the decode stage until the memory access stage of the immediately preceding instruction is completed. In response to the above, even for the subsequent instruction having no idle period, decoding is stopped for waiting the operation of the instruction processing stage after the decode stage until the memory access stage of the load instruction and the store instruction is completed. 2. The event detection circuit according to claim 1, wherein the event detection circuit generates a control signal for setting a period.
【請求項6】 前記イベント用命令デコード手段は、デ
コード停止期間設定用の制御信号が生成されても、前記
イベントを検出が有効とならない限りデコード停止期間
後は直ちに後続命令の命令実行ステージ以降の命令処理
ステージを連続して実行する請求項1記載のデバッグ用
CPUに内蔵のイベント検出回路。
6. The event instruction decoding means, even if a control signal for setting a decoding stop period is generated, immediately after the decoding stop period unless the detection of the event becomes valid, after the instruction execution stage of the subsequent instruction. 2. The event detection circuit built in a debugging CPU according to claim 1, wherein the instruction processing stage is executed continuously.
【請求項7】 前記命令コード解析手段は、デコーダと
アドレス用レジスタ選択回路と転送用レジスタ選択回路
とを含み、前記デコーダは、命令キューを介して入力さ
れた命令コードを2進データに変換しその2進データの
中で命令の種類を表すビットがロードもしくはストア命
令であれば、前記デコード処理制御信号を命令デコーダ
に出力し、前記アドレス用レジスタ選択回路および前記
転送用レジスタ選択回路は、前記2進データから命令コ
ードにより指定されたレジスタがどのレジスタであるが
を示す信号として、アドレス用レジスタ選択信号および
転送用レジスタ選択信号のうちのそれぞれ対応する1つ
を出力する請求項2記載のデバッグ用CPUに内蔵のイ
ベント検出回路。
7. The instruction code analysis means includes a decoder, an address register selection circuit, and a transfer register selection circuit, wherein the decoder converts an instruction code input via an instruction queue into binary data. If the bit indicating the type of the instruction in the binary data is a load or store instruction, the decode processing control signal is output to an instruction decoder, and the address register selection circuit and the transfer register selection circuit 3. The debug according to claim 2, wherein a corresponding one of the address register selection signal and the transfer register selection signal is output as a signal indicating which register is specified by the instruction code from the binary data. Event detection circuit built into the CPU.
【請求項8】 前記アクセスアドレス生成部は、データ
長拡張用シフタおよびアドレス加算器を含み、前記デー
タ長拡張用シフタはアドレス生成に必要なデータに変換
するためのアドレスディスプレースメントデータのビッ
ト幅の符号拡張を行い、前記アドレス加算器は変換され
たディスプレースメントデータである拡張後ディスプレ
ースメントデータとレジスタ間接アドレッシングのため
のレジスタデータとを加算し実際にアクセス対象となる
アクセスアドレスを算出する請求項1記載のデバッグ用
CPUに内蔵のイベント検出回路。
8. The access address generation section includes a data length extension shifter and an address adder, wherein the data length extension shifter has a bit width of address displacement data for converting into data required for address generation. The address adder performs sign extension, and the address adder adds an extended displacement data, which is converted displacement data, and register data for register indirect addressing to calculate an access address to be actually accessed. An event detection circuit built in the debug CPU described above.
【請求項9】 前記イベント処理手段は、イベントアド
レスレジスタおよびアドレスコンパレータを含み、前記
イベントアドレスレジスタは、イベント検出したい条件
のうちアドレスに関する情報を設定する格納領域であり
外部のイベント管理領域からイベントデータバスを介し
て情報が送られるとイベントイネーブル信号およびイベ
ントアドレスを出力し、前記アドレスコンパレータは、
比較器のほかに前記命令コード解析手段が生成するロー
ド命令選択信号と前記ストア命令選択信号とを受けてど
ちらか一方が有効の場合にコンパレータイネーブル信号
を出力する排他的論理和回路を含み、前記イベントアド
レスおよび前記アクセスアドレス生成部の出力するアク
セスアドレスの比較結果が一致し、かつ前記コンパレー
タイネーブル信号の活性化時にアドレス一致検出信号を
出力する請求項1記載のデバッグ用CPUに内蔵のイベ
ント検出回路。
9. The event processing means includes an event address register and an address comparator, wherein the event address register is a storage area for setting information on an address among conditions to be detected, and stores event data from an external event management area. When information is sent via the bus, an event enable signal and an event address are output, and the address comparator
In addition to the comparator, an exclusive OR circuit that receives a load instruction selection signal generated by the instruction code analysis unit and the store instruction selection signal and outputs a comparator enable signal when one of them is valid, 2. The event detection circuit built in the debug CPU according to claim 1, wherein a comparison result between the event address and the access address output from the access address generation unit matches, and an address match detection signal is output when the comparator enable signal is activated. .
【請求項10】 ロード命令およびストア命令に代表さ
れるメモリアクセスを伴う命令を命令デコードのデコー
ドタイミングでイベント用命令をデコードするために命
令フェッチ手段出力後の信号遅延短縮手段として、前記
イベント検出手段を前記デバッグ用CPUの命令デコー
ダに隣接配置したレイアウト構造を有する請求項1記載
のデバッグ用CPUに内蔵のイベント検出回路。
10. An event detecting means as a signal delay reducing means after outputting an instruction fetch means for decoding an instruction for an event involving a memory access represented by a load instruction and a store instruction at the decode timing of the instruction decode. 2. The event detection circuit built in the debug CPU according to claim 1, wherein the event detection circuit has a layout structure in which is disposed adjacent to an instruction decoder of the debug CPU.
【請求項11】 プログラム開発に用いる開発支援装置
のデバッグ用CPUに内蔵のイベント検出回路のイベン
ト検出方法において、前記デバッグ用CPUが実行中の
デバッグプログラムの命令をデコードするタイミングと
同じタイミングで、前記デバッグプログラムからロード
命令またはストア命令のみを命令コード解析手段により
デコードし後続する次命令のデコードを予め定める期間
停止させるとともに、前記アクセスアドレスおよび予め
設定したイベントアドレスが一致したときイベント処理
手段の生成するアドレス一致信号により命令実行手段に
割り込みをかけて、前記後続する次命令の実行ステージ
以降の命令処理ステージを無効にさせることを特徴とす
るデバッグ用CPUに内蔵のイベント検出回路のイベン
ト検出方法。
11. An event detection method of an event detection circuit built in a debug CPU of a development support device used for program development, wherein the debug CPU decodes an instruction of a debug program being executed at the same timing. Only the load instruction or the store instruction from the debug program is decoded by the instruction code analyzing means, the decoding of the subsequent instruction is stopped for a predetermined period, and the event processing means generates when the access address matches the preset event address. An event detecting method for an event detecting circuit built in a debugging CPU, wherein an interrupt is interrupted to an instruction executing means by an address match signal to invalidate an instruction processing stage after an execution stage of the succeeding next instruction.
【請求項12】 開発支援装置内のデバッグ用CPUに
内蔵のイベント検出回路によるイベント検出方法におい
て、命令フェッチステージで読み込んだ命令をデコード
する命令デコード手段のほかに、読み込んだ前記命令か
らロード命令およびストア命令を抽出する命令コード解
析手段および読み込んだ前記命令のアクセスアドレスを
生成するアクセスアドレス生成手段とを含むイベント用
命令デコード手段と、予めイベントアドレスが設定され
るイベントレジスタ手段と前記イベントアドレスおよび
前記アクセスアドレスを比較し一致するとアドレス一致
信号を出力するアドレスコンパレータとを含むイベント
処理手段とを用いて、前記命令デコード手段と同様のタ
イミングで並列にデコード対象命令のデコード処理を行
い、前記命令がロード命令あるいはストア命令であれば
デコード処理制御信号を出力して前記命令デコード手段
に対し実行中の処理をラッチおよび停止させるととも
に、前記アクセスアドレス生成手段によりメモリアクセ
スの対象となるアドレスを確定させた後、確定した前記
ドレスと前記イベントアドレスとが一致するとアドレス
一致検出信号を出力させ、このアドレス一致検出信号に
より命令実行手段内の割り込み処理部に割り込みを発生
させて前記命令実行手段の動作を停止させることを特徴
とするデバッグ用CPUに内蔵のイベント回路によるイ
ベント検出方法。
12. An event detection method using an event detection circuit built in a debugging CPU in a development support apparatus, wherein in addition to an instruction decoding means for decoding an instruction read in an instruction fetch stage, a load instruction and a load instruction are read from the read instruction. An instruction decoding means for an event including an instruction code analyzing means for extracting a store instruction and an access address generating means for generating an access address of the read instruction; an event register means for setting an event address in advance; Using an event processing means including an address comparator which outputs an address match signal when the access addresses are compared and matched, decodes the instruction to be decoded in parallel at the same timing as the instruction decoding means, and If the instruction is a store instruction or a store instruction, a decode processing control signal is output to latch and stop the processing being executed for the instruction decode means, and the address to be accessed by the memory is determined by the access address generation means. Thereafter, when the determined address and the event address match, an address match detection signal is output, and an interrupt is generated in an interrupt processing unit in the instruction execution means by the address match detection signal to stop the operation of the instruction execution means. An event detection method using an event circuit built in a debugging CPU.
【請求項13】 命令フェッチステージで読み込んだ命
令からロード命令およびストア命令を抽出し後続する次
命令のデコードを予め定める期間停止させる命令コード
解析手段および読み込んだ前記命令のアクセスアドレス
を生成するアクセスアドレス生成手段からなるイベント
用命令デコード手段と、前記アクセスアドレスおよび予
め設定したイベントアドレスが一致したとき命令実行手
段に割り込みをかけて前記後続する次命令の実行ステー
ジ以降の命令処理ステージを無効にするためのアドレス
一致信号を生成するイベント処理手段とからなるイベン
ト検出回路を備えるデバッグ用CPUの外部にトレース
部を有し、前記トレース部は、命令フェッチバス、外部
アドレスバスおよび外部データバスに接続されプログラ
ム実行の経過が書き込まれるトレースメモリと、イベン
トの対象となった命令が実行された直後に発行される前
記アドレス一致検出信号に応答してイベントデータをイ
ベントデータバスから取り込みライトイネーブル信号を
生成しそのライトイネーブル信号により前記トレースメ
モリへの誤書き込みが生じないようにトレース開始およ
び終了のタイミングを制御するトレースイベント制御部
とを含んで構成することを特徴とするデバッグ用CPU
の外部周辺回路。
13. An instruction code analyzing means for extracting a load instruction and a store instruction from an instruction read in an instruction fetch stage and stopping the decoding of a subsequent instruction for a predetermined period, and an access address for generating an access address of the read instruction. An instruction decoding means for an event comprising a generation means for interrupting an instruction execution means when the access address matches a preset event address to invalidate an instruction processing stage subsequent to an execution stage of the following next instruction; A trace unit external to a debug CPU provided with an event detection circuit comprising an event processing means for generating an address match signal of the type described above. The trace unit is connected to an instruction fetch bus, an external address bus, and an external data bus, and The progress of execution is written Event data from the event data bus in response to the address match detection signal issued immediately after the instruction of the event to be executed is executed, and a write enable signal is generated. And a trace event control unit for controlling timing of starting and ending the trace so that erroneous writing to the trace memory does not occur.
External peripheral circuit.
【請求項14】 前記トレース部は、前記アドレス一致
検出信号を入力し、トレースの開始、終了を制御するト
レースイベント制御部と、プログラム実行の経過が書き
込まれるトレースメモリとを含み、前記トレースイベン
ト制御部は、イベントデータバスからイベントデータを
受けるトレースイベント比較部と、このトレースイベン
ト比較部の出力信号および前記アドレス一致検出信号を
受けライトイネーブル信号を出力する論理積回路とを含
んで構成される請求項13記載のデバッグ用CPUの外
部周辺回路。
14. The trace event control unit, comprising: a trace event control unit that inputs the address match detection signal and controls start and end of a trace; and a trace memory in which the progress of program execution is written. The unit includes: a trace event comparison unit that receives event data from an event data bus; and an AND circuit that receives an output signal of the trace event comparison unit and the address match detection signal and outputs a write enable signal. Item 14. An external peripheral circuit of the debugging CPU according to item 13.
【請求項15】 命令フェッチステージで読み込んだ命
令からロード命令およびストア命令を抽出し後続命令の
デコードを予め定める期間停止させる命令コード解析手
段および読み込んだ前記命令のアクセスアドレスを生成
するアクセスアドレス生成手段からなるイベント用命令
デコード手段と、前記アクセスアドレスおよび予め設定
したイベントアドレスが一致したとき命令実行手段に割
り込みをかけて前記後続命令の実行ステージ以降の命令
処理ステージを無効にするためのアドレス一致信号を生
成するイベント処理手段とからなるイベント検出回路を
備えるデバッグ用CPUの外部にタイマ部を有し、前記
タイマ部は、タイマカウンタと、イベントの対象となっ
た命令が実行された直後に発行される前記アドレス一致
検出信号に応答してイベントデータをバスから取り込み
カウントスタート信号およびカウントストップ信号を生
成しこれら2つの信号により前記タイマカウンタのカウ
ント回数に誤差が生じないようにカウント開始、終了の
タイミングを制御するタイマイベント制御部とを含んで
構成することを特徴とするデバッグ用CPUの外部周辺
回路。
15. An instruction code analyzing means for extracting a load instruction and a store instruction from an instruction read in an instruction fetch stage and stopping decoding of a subsequent instruction for a predetermined period, and an access address generating means for generating an access address of the read instruction. An instruction decoding means for an event comprising: an address match signal for interrupting the instruction execution means when the access address and the preset event address match to disable an instruction processing stage after the execution stage of the subsequent instruction. A timer unit is provided outside the debugging CPU provided with an event detection circuit comprising an event processing means for generating a timer counter, and the timer unit is issued immediately after execution of the instruction targeted by the event. In response to the address match detection signal A timer event control unit that captures event data from the bus, generates a count start signal and a count stop signal, and controls the timing of starting and ending counting by using these two signals so that an error does not occur in the count number of the timer counter. An external peripheral circuit of a debugging CPU, comprising:
【請求項16】 前記タイマ部は、イベントを使用して
タイマカウンタの開始、終了を制御するタイマイベント
制御部と、イベントによってカウント動作を制御できる
タイマカウンタとを含み、前記タイマイベント制御部
は、イベントデータを受けて比較するタイマイベント比
較部と、このタイマイベント比較部の出力信号および前
記アドレス一致検出信号を受けカウンタスタート信号を
出力する第1の論理積回路と、前記タイマイベント比較
部の愛2の出力信号および前記アドレス一致検出信号を
受けカウンタストップ信号を出力する第2の論理積回路
とを含んで構成される請求項15記載のデバッグ用CP
Uの外部周辺回路。
16. The timer unit includes: a timer event control unit that controls start and end of a timer counter using an event; and a timer counter that can control a count operation by an event, wherein the timer event control unit includes: A timer event comparator for receiving and comparing the event data, a first AND circuit for receiving the output signal of the timer event comparator and the address match detection signal and outputting a counter start signal, 16. The debug CP according to claim 15, further comprising: a second AND circuit that receives the output signal of No. 2 and the address match detection signal and outputs a counter stop signal.
External peripheral circuit of U.
JP2000361851A 2000-11-28 2000-11-28 Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit Pending JP2002163126A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000361851A JP2002163126A (en) 2000-11-28 2000-11-28 Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000361851A JP2002163126A (en) 2000-11-28 2000-11-28 Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit

Publications (1)

Publication Number Publication Date
JP2002163126A true JP2002163126A (en) 2002-06-07

Family

ID=18833224

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000361851A Pending JP2002163126A (en) 2000-11-28 2000-11-28 Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit

Country Status (1)

Country Link
JP (1) JP2002163126A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010541067A (en) * 2007-09-28 2010-12-24 フリースケール セミコンダクター インコーポレイテッド System and method for monitoring debug events
JP2011060129A (en) * 2009-09-11 2011-03-24 Nec Corp Out-of-order execution processor
CN104881342A (en) * 2015-06-24 2015-09-02 小米科技有限责任公司 Terminal testing method and device
JP2022052542A (en) * 2020-09-23 2022-04-04 東芝情報システム株式会社 Ffu inspection device and ffu inspection program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010541067A (en) * 2007-09-28 2010-12-24 フリースケール セミコンダクター インコーポレイテッド System and method for monitoring debug events
JP2011060129A (en) * 2009-09-11 2011-03-24 Nec Corp Out-of-order execution processor
CN104881342A (en) * 2015-06-24 2015-09-02 小米科技有限责任公司 Terminal testing method and device
CN104881342B (en) * 2015-06-24 2018-10-12 小米科技有限责任公司 terminal test method and device
JP2022052542A (en) * 2020-09-23 2022-04-04 東芝情報システム株式会社 Ffu inspection device and ffu inspection program
JP7436848B2 (en) 2020-09-23 2024-02-22 東芝情報システム株式会社 FFU inspection device and FFU inspection program

Similar Documents

Publication Publication Date Title
US5430862A (en) Emulation of CISC instructions by RISC instructions using two pipelined stages for overlapped CISC decoding and RISC execution
JP2003085000A (en) Trace information production device and its method
JPH07120338B2 (en) Method for a data processor to coordinate the execution of instructions by a coprocessor and the data processor
CA2003004C (en) Apparatus and method for executing a conditional branch instruction
JP2002163126A (en) Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit
JP2646957B2 (en) Microprocessor with built-in cache and its trace system
EP0569987A1 (en) Microprocessor incorporating cache memory enabling efficient debugging
JP2808757B2 (en) Microprocessor for debugging
CN114580329B (en) Real-time debugging method for digital signal processor chip
JPS62197831A (en) Data processor
JPH06348543A (en) Method for connection with input/output simulator
JPS59112350A (en) Supervising and controlling system of program
JP2532560B2 (en) Data processing device for high-performance exception handling
JP3716635B2 (en) Information processing apparatus and interrupt control method thereof
JPH01243167A (en) Data processor
JPH06103109A (en) Data processor and debugging device using the same
JPS5875256A (en) Monitoring system for execution instruction processing state
KR960003052B1 (en) Microprocessor having cashe memory unit
JPS6316350A (en) Microprocessor control system
JP2000250779A (en) Programmable controller
JP2572821B2 (en) Operation processing method by instruction re-execution
JP2926941B2 (en) Instruction decoding device
JPH06202907A (en) Debug support device
JP2927751B2 (en) Information processing apparatus, information processing method, and scheduling apparatus
JP3206394B2 (en) Programmable controller with 5-stage pipeline structure

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20031021