JPH05100853A - Data processor with debug support function - Google Patents
Data processor with debug support functionInfo
- Publication number
- JPH05100853A JPH05100853A JP3259119A JP25911991A JPH05100853A JP H05100853 A JPH05100853 A JP H05100853A JP 3259119 A JP3259119 A JP 3259119A JP 25911991 A JP25911991 A JP 25911991A JP H05100853 A JPH05100853 A JP H05100853A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- stage
- cycle
- operand
- address
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Advance Control (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】この発明は、たとえば、デバッグ
サポート機能を有し、パイプライン処理を行なうデータ
処理装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device having a debug support function and performing pipeline processing.
【0002】[0002]
【従来の技術】通常、各々の命令の実行は、命令の読み
出し、命令デコード、オペランドアドレスの計算、オペ
ランドデータ読み出し、演算実行、結果の格納など、数
サイクルの逐次的操作を経て終了する。従来よりデータ
処理装置のなかには、高速処理を達成するために、これ
らの動作を分割して流れ作業的に行なうことによって、
複数の命令の実行を同時に重ね合わせて行ない、理想的
には1サイクル(1つの逐次的操作の実行時間)ごとに
1命令の実行結果が得られる、パイプライン処理機構を
有するものがある。2. Description of the Related Art Normally, execution of each instruction is completed through several cycles of sequential operations such as instruction reading, instruction decoding, operand address calculation, operand data reading, operation execution, and result storage. In order to achieve high-speed processing, some data processing devices have been divided into these operations and performed in a streamlined manner.
There is a pipeline processing mechanism in which execution of a plurality of instructions is performed simultaneously at the same time, and ideally, the execution result of one instruction is obtained for each cycle (execution time of one sequential operation).
【0003】また、データ処理装置内部にデバッグ機能
を有することにより、プログラムの開発効率を向上させ
ているものがある。Some data processing apparatuses have a debugging function to improve program development efficiency.
【0004】図5は従来のデータ処理装置の一例の機能
ブロックを示すものである。CPU1a中の2は、命令
をフェッチして命令キュー3に入力する命令フェッチス
テージ(以下IFステージとする)、4はIFステージ
から受け取った命令のデコードを行なうデコーダー5を
含んだ命令デコードステージ(以下Dステージとする)
で、命令コードや、アドレス計算情報コード生成すると
ともに、各命令のプログラムカウンタ(以下PCとす
る)値を計算し、出力する。6はDステージで生成され
たアドレス計算情報コードによって、オペランドのアド
レス計算を行ない、実効アドレスをフェッチする、オペ
ランドアドレス計算ステージ(以下Aステージとす
る)、7は命令実行に必要なデータを、Aステージで計
算したオペランドの実効アドレスからフェッチする、オ
ペランドフェッチステージ(以下Fステージとする)、
8は、指定された命令の実行を行なう命令実行ステージ
(以下Eステージ)で、ここには、32ビットの汎用レ
ジスタ群9や制御レジスタ群10a、および演算器11
などが含まれ、命令実行結果をオペランドへと書き込
む。12は外部メモリとの通信を制御するバスインター
フェース部で、IFステージ2から生じる外部メモリ1
3に対する命令フェッチ要求や、Aステージ6から生じ
る外部メモリ13に対する実効アドレス計算に必要なデ
ータの読み込み要求、Fステージ7から生じる外部メモ
リ13に対するオペランドデータ読み込み要求、Eステ
ージ8から生じる外部メモリ13に対するオペランドア
クセス(リードまたはライト)要求などを調停する。FIG. 5 shows functional blocks of an example of a conventional data processing device. 2 in the CPU 1a is an instruction fetch stage for fetching an instruction and inputs it to the instruction queue 3 (hereinafter referred to as an IF stage), and 4 is an instruction decode stage including a decoder 5 for decoding an instruction received from the IF stage (hereinafter, referred to as an IF decode stage). D stage)
Then, the instruction code and the address calculation information code are generated, and the program counter (hereinafter referred to as PC) value of each instruction is calculated and output. 6 is an operand address calculation stage (hereinafter, referred to as A stage) that performs operand address calculation by the address calculation information code generated in the D stage and fetches an effective address, and 7 is data required for instruction execution Operand fetch stage (hereinafter referred to as F stage) that fetches from the effective address of the operand calculated in the stage,
Reference numeral 8 denotes an instruction execution stage (hereinafter referred to as E stage) for executing a designated instruction, in which a 32-bit general-purpose register group 9, a control register group 10a, and an arithmetic unit 11 are provided.
Etc. are included, and the instruction execution result is written to the operand. Reference numeral 12 is a bus interface unit for controlling communication with an external memory, which is an external memory 1 generated from the IF stage 2.
3, an instruction fetch request to A3, a read request for data required for effective address calculation to the external memory 13 from the A stage 6, an operand data read request to the external memory 13 from the F stage 7, and an external memory 13 from the E stage 8. Arbitrates operand access (read or write) requests.
【0005】23はクロック信号(以下CLKとす
る)、24は”L”で有効となる、バスサイクルの開始
を示すバススタート信号(以下BSとする)、22は外
部メモリ13のアドレスを指定するアドレスバス(以下
ADとする)、21は外部メモリ13とCPU1aとで
データの転送を行なうデータバス(以下Dとする)、2
5は”H”でリードを示し、”L”でライトを示し、デ
ータ転送の方向を示すリード/ライト信号(以下R/W
とする)、26は”L”で有効となる、データ転送の完
了を示すデータトランスファコンプリート信号(以下D
Cとする)である。Reference numeral 23 is a clock signal (hereinafter referred to as CLK), 24 is a bus start signal (hereinafter referred to as BS) which is valid at "L" and indicates the start of a bus cycle, and 22 designates an address of the external memory 13. An address bus (hereinafter referred to as AD), 21 is a data bus (hereinafter referred to as D) for transferring data between the external memory 13 and the CPU 1a, 2
Reference numeral 5 indicates “H” for reading, “L” for writing, and a read / write signal (hereinafter R / W) indicating the direction of data transfer.
, 26 is a data transfer complete signal (hereinafter D), which is valid at “L” and indicates the completion of data transfer.
C).
【0006】図6は図5の制御レジスタ10aのうち、
デバッグ環境を制御するデバッグ環境制御レジスタ(以
下DBCレジスタとする)を詳しく表わしたもので、S
Aビット31によりトレースモードでデバッグ事象を検
出したかどうかを表わし、EAビット32により命令実
行によりデバッグ事象を検出したかどうか、RAビット
33によりオペランドからの読み出しでデバッグ事象を
検出したかどうか、WAビット34によりオペランドへ
の書き込みによりデバッグ事象を検出したかどうかを表
わしている。FIG. 6 shows a control register 10a of FIG.
A detailed description of the debug environment control register (hereinafter referred to as the DBC register) that controls the debug environment.
The A bit 31 indicates whether a debug event is detected in the trace mode, the EA bit 32 detects whether a debug event is detected by executing an instruction, the RA bit 33 indicates whether a debug event is detected by reading from an operand, WA Bit 34 indicates whether a debug event was detected by writing to the operand.
【0007】外部メモリ13の0番地から2番地に、そ
れぞれ命令A、B、Cが格納されており、これらの命令
がCPU1aに順に読み込まれてパイプライン処理され
るときの各ステージでの命令処理の流れと、各サイクル
でのバスオペレーションの様子を図7を用いて説明す
る。Instructions A, B, and C are stored at addresses 0 to 2 of the external memory 13, respectively, and the instruction processing at each stage when these instructions are sequentially read by the CPU 1a and pipelined. 7 and the bus operation in each cycle will be described with reference to FIG.
【0008】バスサイクルはCPU1aがBS24をア
サートすることにより開始し、外部メモリ13よりDC
26が入力されることにより終了する。BSアサートと
同時にAD22,R/W25も出力される。図7の第1
サイクルでは、CPU1aがBS24をアサートし、転
送方向R/W=”H”を出力してAD22から外部メモ
リ13の0番地を指定するアドレス信号を出し、0番地
の命令AをD21を通して読み込み、IFステージ2の
命令キュー3に格納する。バスサイクルはDC26の入
力により終了する。第2サイクルでは、CPU1aがB
S24をアサートし、命令AはDステージ4へと送ら
れ、デコーダー5でデコードされる。また命令AのPC
値が計算される。第2サイクルではBS24アサートと
同時に、CPU1aが転送方向R/W=”H”を出力し
てAD22から外部メモリ13の1番地を指定するアド
レス信号を出し、1番地から命令BをD21を通してI
Fステージ2の命令キュー3に格納する。第3サイクル
では、IFステージ2で命令Cのフェッチ、Dステージ
4で命令Bのデコード、Aステージ6で命令Aのオペラ
ンドのアドレス計算と、3つの処理が同時に行なわれ
る。このように、基本的には1サイクルごとに命令が各
ステージを流れて処理されていく。The bus cycle starts when the CPU 1a asserts BS24, and the external memory 13 causes the DC cycle.
When 26 is input, the process ends. AD22 and R / W25 are also output at the same time when BS is asserted. First of FIG.
In the cycle, the CPU 1a asserts BS24, outputs the transfer direction R / W = "H", issues an address signal designating address 0 of the external memory 13 from AD22, reads the instruction A at address 0 through D21, and outputs IF Store in instruction queue 3 of stage 2. The bus cycle ends with the input of DC26. In the second cycle, the CPU 1a
Assert S24, the instruction A is sent to the D stage 4, and is decoded by the decoder 5. Command A PC
The value is calculated. In the second cycle, at the same time when BS24 is asserted, the CPU 1a outputs the transfer direction R / W = "H", outputs an address signal designating the first address of the external memory 13 from the AD22, and outputs the instruction B from the first address through the D21.
Store in the instruction queue 3 of the F stage 2. In the third cycle, the fetching of the instruction C in the IF stage 2, the decoding of the instruction B in the D stage 4, the address calculation of the operand of the instruction A in the A stage 6, and the three processes are simultaneously performed. In this way, basically, an instruction flows through each stage and is processed every cycle.
【0009】しかし第5サイクルでは、Eステージ8で
の命令Aの外部メモリ13への書き込み要求と、Fステ
ージ7での命令Bの外部メモリ13からのオペランド読
み込み要求の2つのメモリアクセス要求が同時に起こる
ので、バスインターフェース部12で調停を行ない、こ
こではEステージ8での命令Aのメモリへの書き込みを
優先させ、この処理が終わるまで、命令BのFステージ
7での処理が遅延される。第5サイクルでの外部メモリ
13への書き込み動作は、BS24をアサートすること
で始まり、つぎにR/W=”L”を出力し、AD22か
らアドレスを出力する。その後データをD21より出力
し、DC26の入力によりバスサイクルを終了する。However, in the fifth cycle, two memory access requests, a write request for the instruction A to the external memory 13 in the E stage 8 and an operand read request for the instruction B from the external memory 13 in the F stage 7, are simultaneously performed. Since this occurs, arbitration is performed in the bus interface unit 12, where the writing of the instruction A to the memory in the E stage 8 is given priority, and the processing of the instruction B in the F stage 7 is delayed until this processing ends. The write operation to the external memory 13 in the fifth cycle starts by asserting BS24, then outputs R / W = "L", and outputs the address from the AD22. After that, the data is output from D21, and the bus cycle is ended by the input of DC26.
【0010】また第6サイクルでは、Fステージ7で命
令Bのオペランドが外部メモリ13から読み込まれるの
で、命令Cの処理は、Aステージ6でFステージ7が空
くのを待っている間、遅延される。このように次ステー
ジで前命令の処理が行なわれている間も、その処理が完
了するまで処理が遅延される。In the sixth cycle, since the operand of the instruction B is read from the external memory 13 in the F stage 7, the processing of the instruction C is delayed while waiting for the F stage 7 to be vacant in the A stage 6. It As described above, even while the processing of the previous instruction is being performed in the next stage, the processing is delayed until the processing is completed.
【0011】上記のように、従来のパイプライン処理を
行なうデータ処理装置では、命令をフェッチしてから処
理を完全におえるまでに時差があり、複数個の命令を同
時に処理するので、デバッグ環境を制御するレジスタを
参照することによって、デバッグ事象が発生しているか
否かを判定できるが、オペランドアクセスが行なわれた
ときに、そのアクセスがどの命令によって行なわれたか
等の情報を瞬時に得ることはできなかった。As described above, in the conventional data processing device for pipeline processing, there is a time lag between the fetching of an instruction and the complete processing, and a plurality of instructions are processed at the same time. Although it is possible to determine whether or not a debug event has occurred by referring to the control register, when an operand access is performed, it is not possible to instantaneously obtain information such as which instruction performed the access. could not.
【0012】[0012]
【発明が解決しようとする課題】この発明はかかる問題
を解決するためになされたもので、デバッグ作業時に命
令とオペランドアクセスの対応を明確にして、プログラ
ムデバッグを容易にすることを目的とする。SUMMARY OF THE INVENTION The present invention has been made in order to solve such a problem, and an object thereof is to clarify the correspondence between instruction and operand access at the time of debugging work to facilitate program debugging.
【0013】[0013]
【課題を解決するための手段】この発明に係るデータ処
理装置は、たとえば、デバッグ環境を制御するレジスタ
等の中に命令とオペランドアクセスの対応を明確にする
モードを指定するビット(モード指定手段の一例)を備
え、オペランドアクセスに対応する命令のPC値(識別
子の一例)を出力する命令識別手段を備えたものであ
る。In a data processing device according to the present invention, for example, in a register or the like for controlling a debug environment, a bit (a mode designating means of a mode designating means) for designating a mode for clarifying a correspondence between an instruction and an operand access is provided. One example), and an instruction identifying means for outputting a PC value (an example of an identifier) of an instruction corresponding to operand access.
【0014】[0014]
【作用】この発明によれば、デバッグ環境を制御するレ
ジスタ中の上記のビット(モード指定手段)がセットさ
れているとき、命令識別手段がオペランドアクセスのバ
スサイクル中または前後に、そのオペランドアクセスに
対応する命令のPC値を出力する。According to the present invention, when the above-mentioned bit (mode designating means) in the register for controlling the debug environment is set, the instruction identifying means can access the operand access during or before or after the operand access bus cycle. The PC value of the corresponding instruction is output.
【0015】[0015]
実施例1.以下この発明の一実施例として、デバッグ環
境を制御するレジスタを持ち、前記レジスタ中に命令と
オペランドの対応を明確にするために、オペランドアク
セスのバスサイクルの後に、対応する命令のPC値を出
力するかどうかを指定するビットを持つパイプラインデ
ータ処理装置について、図1〜図3を用いて説明する。Example 1. As one embodiment of the present invention, a register for controlling a debug environment is provided and a PC value of a corresponding instruction is output after a bus cycle of an operand access in order to clarify the correspondence between the instruction and the operand in the register. A pipeline data processing device having a bit that specifies whether or not to do so will be described with reference to FIGS.
【0016】図1は本発明のデータ処理装置の一例の機
能ブロックを示すものである。CPU1b中の2は、命
令をフェッチして命令キュー3に入力する命令フェッチ
ステージ(以下IFステージとする)、4はIFステー
ジから受け取った命令のデコードを行なうデコーダー5
を含んだ命令デコードステージ(以下Dステージとす
る)で、命令コードや、アドレス計算情報コード生成す
るとともに、各命令のプログラムカウンタ(以下PCと
する)値を計算し、出力する。6はDステージで生成さ
れたアドレス計算情報コードによってオペランドのアド
レス計算を行ない、実効アドレスをフェッチする、オペ
ランドアドレス計算ステージ(以下Aステージとす
る)、7は、命令実行に必要なデータを、Aステージで
計算したオペランドの実効アドレスからフェッチする、
オペランドフェッチステージ(以下Fステージとす
る)、8は、指定された命令の実行を行なう命令実行ス
テージ(以下Eステージ)で、ここには、32ビットの
汎用レジスタ群9や制御レジスタ群10b、および演算
器11などが含まれ、命令実行結果をオペランドへと書
き込む。12は外部メモリとの通信を制御するバスイン
ターフェース部で、IFステージ2から生じる外部メモ
リ13に対する命令フェッチ要求や、Aステージ6から
生じる外部メモリ13に対する実効アドレス計算に必要
なデータの読み込み要求、Fステージ7から生じる外部
メモリ13に対するオペランドデータ読み込み要求、E
ステージ8から生じる外部メモリ13に対するオペラン
ドアクセス(リードまたはライト)要求などを調停す
る。FIG. 1 shows a functional block of an example of a data processing device of the present invention. 2 in the CPU 1b is an instruction fetch stage (hereinafter referred to as an IF stage) that fetches an instruction and inputs it to the instruction queue 3. 4 is a decoder 5 that decodes the instruction received from the IF stage.
In the instruction decoding stage (hereinafter referred to as D stage) including, the instruction code and the address calculation information code are generated, and the program counter (hereinafter referred to as PC) value of each instruction is calculated and output. 6 is an operand address calculation stage (hereinafter referred to as A stage) that performs operand address calculation by the address calculation information code generated in the D stage and fetches an effective address, and 7 is the data necessary for instruction execution Fetch from the effective address of the operand calculated in the stage,
An operand fetch stage (hereinafter referred to as F stage) 8 is an instruction execution stage (hereinafter referred to as E stage) that executes a designated instruction, and includes a 32-bit general-purpose register group 9 and a control register group 10b. The arithmetic unit 11 and the like are included, and the instruction execution result is written in the operand. Reference numeral 12 denotes a bus interface unit for controlling communication with an external memory, which includes an instruction fetch request from the IF stage 2 to the external memory 13 and a data read request from the A stage 6 to read external data required for effective address calculation. Operand data read request to external memory 13 from stage 7, E
It arbitrates an operand access (read or write) request to the external memory 13 that occurs from the stage 8.
【0017】23はクロック信号(以下CLKとす
る)、24はバスサイクルの開始を示すバススタート信
号(以下BSとする)、22は外部メモリ13のアドレ
スを指定するアドレスバス(以下ADとする)、21は
外部メモリ13とCPU1bとでデータの転送を行なう
データバス(以下Dとする)、25はデータ転送の方向
を示すリード/ライト信号(以下R/Wとする)、26
はデータ転送の完了を示すデータトランスファコンプリ
ート信号(以下DCとする)である。Reference numeral 23 is a clock signal (hereinafter referred to as CLK), 24 is a bus start signal (hereinafter referred to as BS) indicating the start of a bus cycle, and 22 is an address bus (hereinafter referred to as AD) for designating an address of the external memory 13. , 21 is a data bus (hereinafter referred to as D) for transferring data between the external memory 13 and the CPU 1b, 25 is a read / write signal (hereinafter referred to as R / W) indicating the direction of data transfer, 26
Is a data transfer complete signal (hereinafter referred to as DC) indicating the completion of data transfer.
【0018】図2は図1の制御レジスタ10bのうち、
本発明のデータ処理装置のデバッグ環境を制御するデバ
ッグ環境制御レジスタ(以下DBCレジスタとする)を
詳しく表わしたもので、Aビット35によりオペランド
アクセスの後に、対応する命令のPC値を出力するかど
うかを指定し、SAビット31によりトレースモードで
デバッグ事象を検出したかどうかを表わし、EAビット
32により命令実行によりデバッグ事象を検出したかど
うか、RAビット33によりオペランドからの読み出し
でデバッグ事象を検出したかどうか、WAビット34に
よりオペランドへの書き込みによりデバッグ事象を検出
したかどうかを表わしている。FIG. 2 shows the control register 10b of FIG.
It is a detailed representation of a debug environment control register (hereinafter referred to as a DBC register) for controlling the debug environment of the data processor of the present invention. Whether or not the PC value of the corresponding instruction is output after the operand access by the A bit 35. Is specified, the SA bit 31 indicates whether a debug event is detected in the trace mode, the EA bit 32 indicates whether a debug event is detected by instruction execution, and the RA bit 33 detects a debug event by reading from the operand. The WA bit 34 indicates whether or not a debug event is detected by writing to the operand.
【0019】外部メモリ13の0番地から2番地に、そ
れぞれ命令A、B、Cが格納されており、これらの命令
がCPU1bに順に読み込まれてパイプライン処理され
るときの各ステージでの命令処理の流れと、各サイクル
でのバスオペレーションの様子を図3を用いて説明す
る。Instructions A, B, and C are stored at addresses 0 to 2 of the external memory 13, respectively, and instruction processing at each stage when these instructions are sequentially read by the CPU 1b and pipelined. And the bus operation in each cycle will be described with reference to FIG.
【0020】バスサイクルはCPU1bがBS24をア
サートすることにより開始し、外部メモリ13よりDC
26が入力されることにより終了する。BSアサートと
同時にAD22,R/W25も出力される。図3の第1
サイクルでは、CPU1bがBS24をアサートし、転
送方向R/W=”H”を出力してAD22から外部メモ
リ13の0番地を指定するアドレス信号を出し、0番地
の命令AをD21を通して読み込み、IFステージ2の
命令キュー3に格納する。バスサイクルはDC26の入
力により終了する。第2サイクルでは、CPU1bがB
S24をアサートし、命令AはDステージ4へと送ら
れ、デコーダー5でデコードされる。また命令AのPC
値が計算される。第2サイクルではBS24アサートと
同時に、CPU1bが転送方向R/W=”H”を出力し
てAD22から外部メモリ13の1番地を指定するアド
レス信号を出し、1番地から命令BをD21を通してI
Fステージ2の命令キュー3に格納する。第3サイクル
では、IFステージ2で命令Cのフェッチ、Dステージ
4で命令Bのデコード、Aステージ6で命令Aのオペラ
ンドのアドレス計算と、3つの処理が同時に行なわれ
る。このように、オペランドアクセスがない場合、従来
のデータ処理装置と同様、基本的に1サイクルごとに命
令が各ステージを流れて処理されていく。The bus cycle is started by the CPU 1b asserting BS24, and the external memory 13 causes the DC cycle.
When 26 is input, the process ends. AD22 and R / W25 are also output at the same time when BS is asserted. First of FIG.
In the cycle, the CPU 1b asserts BS24, outputs the transfer direction R / W = "H", issues an address signal designating address 0 of the external memory 13 from AD22, reads the instruction A at address 0 through D21, and outputs IF Store in instruction queue 3 of stage 2. The bus cycle ends with the input of DC26. In the second cycle, CPU 1b
Assert S24, the instruction A is sent to the D stage 4, and is decoded by the decoder 5. Command A PC
The value is calculated. In the second cycle, at the same time when BS24 is asserted, the CPU 1b outputs the transfer direction R / W = “H”, issues an address signal designating the first address of the external memory 13 from the AD22, and outputs the instruction B from the first address through the D21.
Store in the instruction queue 3 of the F stage 2. In the third cycle, the fetching of the instruction C in the IF stage 2, the decoding of the instruction B in the D stage 4, the address calculation of the operand of the instruction A in the A stage 6, and the three processes are simultaneously performed. In this way, when there is no operand access, an instruction basically flows through each stage and is processed every cycle, as in the conventional data processing device.
【0021】第4サイクルでは命令Aのオペランドをフ
ェッチするためにオペランドアクセスが起こっている。
このような場合、オペランドアクセスのすぐ後のサイク
ル、すなわち第5サイクルでは、オペランドアクセスを
起こした命令AのPC値0を信号線AD22へと出力す
る。この時、R/W25はHのままでBS24はアサー
トされないので、第5サイクルでは命令Aのアドレスが
信号線AD22に出力されるだけで、メモリ13への読
み込み、書き込み等のアクセスは行なわれない。このよ
うに、信号線AD22に出力された命令Aのアドレス
は、図示していないデバック手段により検出されること
になる。第6サイクルは命令Aのライトサイクルで、ラ
イト終了後の第7サイクルで、命令AのPC値0がAD
22に出力される。この時、R/W25はLのままでB
S24はアサートされない。第8サイクルは命令Bのオ
ペランドプリフェッチサイクルで、オペランドプリフェ
ッチを行なった後の第9サイクルで、命令BのPC値1
がAD22に出力される。In the fourth cycle, operand access is performed to fetch the operand of instruction A.
In such a case, in the cycle immediately after the operand access, that is, in the fifth cycle, the PC value 0 of the instruction A that caused the operand access is output to the signal line AD22. At this time, since R / W25 remains H and BS24 is not asserted, the address of the instruction A is only output to the signal line AD22 in the fifth cycle, and the memory 13 is not accessed for reading or writing. .. As described above, the address of the instruction A output to the signal line AD22 is detected by the debug means (not shown). The sixth cycle is the write cycle of the instruction A, and the PC value 0 of the instruction A is AD in the seventh cycle after the write is completed.
22 is output. At this time, R / W25 remains L and B
S24 is not asserted. The eighth cycle is the operand prefetch cycle of the instruction B, and the PC value of the instruction B is 1 in the ninth cycle after the operand prefetch.
Is output to AD22.
【0022】実施例2.なお、実施例1では、デバッグ
制御レジスタ内にオペランドアクセスと命令の対応を明
確にするビットを備えて、上記ビットがセットされてい
るとき、オペランドアクセスサイクルの後にPC値を出
力する場合を示したが、オペランドアクセスサイクルの
途中で対応する命令のPC値を出力することとしても、
同様の効果を得ることができる。データ処理装置に、命
令A、B、Cが順に読み込まれて、パイプライン処理さ
れるときの各サイクルでのバスオペレーションの様子を
図4を用いて説明する。Example 2. In the first embodiment, a bit for clarifying the correspondence between the operand access and the instruction is provided in the debug control register, and when the above bit is set, the PC value is output after the operand access cycle. However, even if the PC value of the corresponding instruction is output during the operand access cycle,
The same effect can be obtained. The state of the bus operation in each cycle when the instructions A, B, and C are sequentially read into the data processing device and pipeline processing will be described with reference to FIG.
【0023】バスサイクルはCPU1bがBS24をア
サートすることにより開始し、外部メモリ13よりDC
26が入力されることにより終了する。BSアサートと
同時にAD22,R/W25も出力される。図4の第1
サイクルでは、CPU1bがBS24をアサートし、転
送方向R/W=”H”を出力してAD22から外部メモ
リ13の0番地を指定するアドレス信号を出し、0番地
の命令AをD21を通して読み込み、IFステージ2の
命令キュー3に格納する。バスサイクルはDC26の入
力により終了する。第2サイクルでは、CPU1bがB
S24をアサートし、命令AはDステージ4へと送ら
れ、デコーダー5でデコードされる。また命令AのPC
値が計算される。第2サイクルではBS24アサートと
同時に、CPU1bが転送方向R/W=”H”を出力し
てAD22から外部メモリ13の1番地を指定するアド
レス信号を出し、1番地から命令BをD21を通してI
Fステージ2の命令キュー3に格納する。第3サイクル
では、IFステージ2で命令Cのフェッチ、Dステージ
4で命令Bのデコード、Aステージ6で命令Aのオペラ
ンドのアドレス計算と、3つの処理が同時に行なわれ
る。このように、オペランドアクセスがない場合、従来
のデータ処理装置と同様、基本的に1サイクルごとに、
命令が各ステージを流れて処理されていく。The bus cycle is started by the CPU 1b asserting BS24, and the external memory 13 causes the DC cycle.
When 26 is input, the process ends. AD22 and R / W25 are also output at the same time when BS is asserted. First of FIG.
In the cycle, the CPU 1b asserts BS24, outputs the transfer direction R / W = "H", issues an address signal designating address 0 of the external memory 13 from AD22, reads the instruction A at address 0 through D21, and outputs IF Store in instruction queue 3 of stage 2. The bus cycle ends with the input of DC26. In the second cycle, CPU 1b
Assert S24, the instruction A is sent to the D stage 4, and is decoded by the decoder 5. Command A PC
The value is calculated. In the second cycle, at the same time when BS24 is asserted, the CPU 1b outputs the transfer direction R / W = “H”, issues an address signal designating the first address of the external memory 13 from the AD22, and outputs the instruction B from the first address through the D21.
Store in the instruction queue 3 of the F stage 2. In the third cycle, the fetching of the instruction C in the IF stage 2, the decoding of the instruction B in the D stage 4, the address calculation of the operand of the instruction A in the A stage 6, and the three processes are simultaneously performed. In this way, when there is no operand access, basically every cycle, like the conventional data processing device,
Instructions flow through each stage and are processed.
【0024】第4サイクルでは命令Aのオペランドをフ
ェッチするためにオペランドアクセス要求が生じてい
る。第4サイクルでは、CPU1bがBS24をアサー
トし、同時にR/W=”H”を出力してデータを外部メ
モリ13から読み込むことを指示し、サイクルの前半
で、オペランドアクセスを起こした命令AのPC値0を
AD22へと出力する。サイクルの後半ではAD22か
ら外部メモリ13の命令Aのオペランドを指定するアド
レス信号を出し、D21を通してデータを読み込む。バ
スサイクルはDC26の入力で終了する。第5サイクル
は命令Aのライトサイクルで、CPU1bがBS24を
アサートし、同時にR/W=”L”を出力してデータを
外部メモリ13に書き込むことを指示し、サイクルの前
半でオペランドアクセスを起こした命令AのPC値0を
AD22へと出力する。サイクルの後半ではAD22か
ら外部メモリ13の命令Aのオペランドを指定するアド
レス信号を出し、D21を通してデータを書き込む。バ
スサイクルはDC26の入力で終了する。第6サイクル
は命令Bのオペランドプリフェッチサイクルで、CPU
1bがBS24をアサートし、同時にR/W=”H”を
出力してデータを外部メモリ13から読み込むことを指
示し、サイクルの前半でオペランドアクセスを起こした
命令BのPC値1をAD22へと出力する。サイクルの
後半ではAD22から外部メモリ13の命令Bのオペラ
ンドを指定するアドレス信号を出し、D21を通してデ
ータを読み込む。バスサイクルはDC26の入力で終了
する。第7サイクルは命令Aのライトサイクルで、CP
U1bがBS24をアサートし、同時にR/W=”L”
を出力してデータを外部メモリ13に書き込むことを指
示し、サイクルの前半でオペランドアクセスを起こした
命令BのPC値1をAD22へと出力する。サイクルの
後半ではAD22から外部メモリ13の命令Bのオペラ
ンドを指定するアドレス信号を出し、D21を通してデ
ータを書き込む。バスサイクルはDC26の入力で終了
する。In the fourth cycle, an operand access request is issued to fetch the operand of instruction A. In the fourth cycle, the CPU 1b asserts BS24, outputs R / W = "H" at the same time to instruct to read the data from the external memory 13, and in the first half of the cycle, the PC of the instruction A that caused the operand access is issued. The value 0 is output to AD22. In the latter half of the cycle, an address signal designating the operand of the instruction A in the external memory 13 is issued from the AD 22 and the data is read through the D 21. The bus cycle ends with the input of DC26. The fifth cycle is a write cycle of the instruction A, and the CPU 1b asserts BS24, outputs R / W = "L" at the same time to instruct to write the data in the external memory 13, and causes an operand access in the first half of the cycle. The PC value 0 of the instruction A is output to the AD 22. In the latter half of the cycle, an address signal designating the operand of the instruction A in the external memory 13 is issued from the AD 22 and the data is written through the D 21. The bus cycle ends with the input of DC26. The sixth cycle is the instruction B operand prefetch cycle, which is the CPU
1b asserts BS24, outputs R / W = "H" at the same time to instruct to read data from the external memory 13, and transfers the PC value 1 of the instruction B that caused the operand access to the AD22 in the first half of the cycle. Output. In the latter half of the cycle, the address signal designating the operand of the instruction B of the external memory 13 is issued from the AD 22 and the data is read through the D 21. The bus cycle ends with the input of DC26. The seventh cycle is the write cycle of instruction A, and CP
U1b asserts BS24 and at the same time R / W = "L"
Is output to instruct to write the data in the external memory 13, and the PC value 1 of the instruction B that caused the operand access in the first half of the cycle is output to the AD 22. In the latter half of the cycle, an address signal designating the operand of the instruction B in the external memory 13 is issued from the AD 22 and the data is written through the D 21. The bus cycle ends with the input of DC26.
【0025】実施例3.なお、実施例1では、デバッグ
制御レジスタ内にオペランドアクセスと命令の対応を明
確にするビットを備えて、このビットがセットされてい
るとき、オペランドアクセスサイクルの後にPC値を出
力する場合を示したが、オペランドアクセスサイクルの
前にPC値を出力することによっても同様の効果を得る
ことができる。Example 3. In the first embodiment, the debug control register has a bit for clarifying the correspondence between the operand access and the instruction, and when this bit is set, the PC value is output after the operand access cycle. However, the same effect can be obtained by outputting the PC value before the operand access cycle.
【0026】実施例4.上記実施例では、デバック制御
レジスタ内のオペランドアクセスと命令の対応を明確に
するためのひとつのビットをモード指定手段の一例とし
て説明したが、このビットは1ビットでなくてもよく、
複数ビットあってもよい。たとえば、2ビットにより、
以下のようにモードを分けてもよい。 00=デバックサポート機能なし 01=実施例1記載のデバックサポート機能実行 10=実施例2記載のデバックサポート機能実行 11=実施例3記載のデバックサポート機能実行Example 4. In the above embodiment, one bit for clarifying the correspondence between the operand access and the instruction in the debug control register has been described as an example of the mode designating means, but this bit does not have to be 1 bit,
There may be multiple bits. For example, with 2 bits,
The modes may be divided as follows. 00 = No debug support function 01 = Debug support function execution described in the first embodiment 10 = Debug support function execution described in the second embodiment 11 = Debug support function execution described in the third embodiment
【0027】実施例5.また、このモード指定手段はデ
バック制御レジスタ内のビットを用いるものとは限ら
ず、プロセッサやCPU内外のその他の専用のレジスタ
やフリップフロップ等の記憶領域を用いてもかまわな
い。また、このビットや記憶領域へのモードのセット
は、プログラムされたソフトウェアによるもの、あるい
は、ディップスイッチ等のハードウェアによるものな
ど、どのような方法であってもかまわない。Example 5. Further, the mode designating means is not limited to using the bits in the debug control register, and other dedicated registers inside or outside the processor or the CPU or a storage area such as a flip-flop may be used. Further, the mode setting to the bit and the storage area may be performed by any method such as by programmed software or by hardware such as a DIP switch.
【0028】実施例6.また、上記実施例では、オペラ
ンドアクセスを例にしたが、オペランド以外のデータを
アクセスする場合でもかまわない。また、上記実施例で
は対応する命令のPC値を出力する場合を示したが、P
C値以外の命令の識別子を出力する場合でもかまわな
い。たとえば、命令の相対アドレスやコードそのものを
識別子として出力してもかまわない。Example 6. In the above embodiment, operand access is taken as an example, but data other than operands may be accessed. In the above embodiment, the case where the PC value of the corresponding instruction is output has been described.
It does not matter even if the instruction identifier other than the C value is output. For example, the relative address of the instruction or the code itself may be output as the identifier.
【0029】[0029]
【発明の効果】以上説明したように、この発明によれ
ば、パイプライン処理を行なうデータ処理装置におい
て、命令とオペランドアクセスとの対応を明確にできる
ので、プログラムデバッグが容易になるという効果があ
る。As described above, according to the present invention, it is possible to clarify the correspondence between the instruction and the operand access in the data processing device for performing the pipeline processing, and thus it is possible to facilitate the program debugging. ..
【図1】本発明のデータ処理装置の一例の機能ブロック
図である。FIG. 1 is a functional block diagram of an example of a data processing device of the present invention.
【図2】本発明のデータ処理装置の一例のデバッグ環境
を制御するレジスタを表わした図である。FIG. 2 is a diagram showing registers that control a debug environment of an example of a data processing device of the present invention.
【図3】本発明のデータ処理装置の一例に、命令A、
B、Cが順に読み込まれて各ステージでパイプライン処
理されるときの、実施例1でのサイクルごとの各ステー
ジでの命令処理の流れと、各信号のバスオペレーション
の様子を表わした図である。FIG. 3 shows an example of a data processing device according to the present invention, which has an instruction A,
FIG. 6 is a diagram showing a flow of instruction processing in each stage in each cycle and a bus operation state of each signal in the first embodiment when B and C are sequentially read and pipeline-processed in each stage. ..
【図4】本発明のデータ処理装置の一例に、命令A、
B、Cが順に読み込まれて各ステージでパイプライン処
理されるときの、実施例2でのサイクルごとの各ステー
ジでの命令処理の流れと、各信号のバスオペレーション
の様子を表わした図である。FIG. 4 shows an example of a data processing apparatus according to the present invention, which has an instruction A,
FIG. 9 is a diagram showing a flow of instruction processing in each stage in each cycle and a bus operation state of each signal in the second embodiment when B and C are sequentially read and subjected to pipeline processing in each stage. ..
【図5】従来のデータ処理装置の機能ブロック図であ
る。FIG. 5 is a functional block diagram of a conventional data processing device.
【図6】従来のデータ処理装置のデバッグ環境を制御す
るレジスタを表わした図である。FIG. 6 is a diagram showing registers that control a debug environment of a conventional data processing device.
【図7】従来のデータ処理装置に命令A、B、Cが読み
込まれたとき、各ステージでパイプライン処理される様
子を表わした図である。FIG. 7 is a diagram showing a state where pipeline processing is performed in each stage when instructions A, B, and C are read in a conventional data processing device.
1b 本発明のCPU 2 命令フェッチステージ 3 命令キュー 4 デコードステージ 5 デコーダー 6 オペランドアドレス計算ステージ 7 オペランドフェッチステージ 8 命令実行ステージ 9 汎用レジスタ群 10b 本発明の制御レジスタ群 11 演算器 12 バスインターフェース部 13 外部メモリ 21 データバス 22 アドレスバス 23 クロック信号 24 バススタート信号 25 リード/ライト信号 26 データトランスファコンプリート信号 31 SAビット 32 EAビット 33 RAビット 34 WAビット 35 Aビット 1b CPU of the present invention 2 instruction fetch stage 3 instruction queue 4 decode stage 5 decoder 6 operand address calculation stage 7 operand fetch stage 8 instruction execution stage 9 general-purpose register group 10b control register group 11 arithmetic unit 12 bus interface unit 13 external Memory 21 Data bus 22 Address bus 23 Clock signal 24 Bus start signal 25 Read / write signal 26 Data transfer complete signal 31 SA bit 32 EA bit 33 RA bit 34 WA bit 35 A bit
Claims (1)
るかどうか指定するモード指定手段と、上記モード指定
が有効なとき、データアクセスに対応する命令の識別子
を出力する命令識別手段を備えたデバッグサポート機能
付データ処理装置。1. Debugging comprising mode designating means for designating whether correspondence between an instruction and data access is explicitly indicated, and instruction identifying means for outputting an identifier of an instruction corresponding to data access when the mode designation is valid. Data processing device with support function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3259119A JPH05100853A (en) | 1991-10-07 | 1991-10-07 | Data processor with debug support function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3259119A JPH05100853A (en) | 1991-10-07 | 1991-10-07 | Data processor with debug support function |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH05100853A true JPH05100853A (en) | 1993-04-23 |
Family
ID=17329583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3259119A Pending JPH05100853A (en) | 1991-10-07 | 1991-10-07 | Data processor with debug support function |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH05100853A (en) |
-
1991
- 1991-10-07 JP JP3259119A patent/JPH05100853A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4750865B2 (en) | Method and apparatus for influencing subsequent instruction processing in a data processor | |
US4729094A (en) | Method and apparatus for coordinating execution of an instruction by a coprocessor | |
KR100335785B1 (en) | Execution of data processing instructions | |
US4731736A (en) | Method and apparatus for coordinating execution of an instruction by a selected coprocessor | |
US4750110A (en) | Method and apparatus for executing an instruction contingent upon a condition present in another data processor | |
JP2620511B2 (en) | Data processor | |
EP0526911B1 (en) | A method and apparatus for coordinating execution of an instruction by a coprocessor | |
US4758950A (en) | Method and apparatus for selectively delaying an interrupt of a coprocessor | |
US4821231A (en) | Method and apparatus for selectively evaluating an effective address for a coprocessor | |
JP3579843B2 (en) | Digital signal processor | |
JPH0743648B2 (en) | Information processing equipment | |
US4967339A (en) | Operation control apparatus for a processor having a plurality of arithmetic devices | |
JP2798121B2 (en) | Data processing device | |
JPH05100853A (en) | Data processor with debug support function | |
EP0573071A2 (en) | A microprocessor | |
JP2002163126A (en) | Event detecting circuit embedded in debugging cpu, event detecting method, and external peripheral circuit | |
JP2999907B2 (en) | Central processing unit with microprogram control | |
JP2806690B2 (en) | Microprocessor | |
US4811274A (en) | Method and apparatus for selectively evaluating an effective address for a coprocessor | |
JP2545594B2 (en) | Operand data prefetching method | |
JPH0241770B2 (en) | ||
JP3206394B2 (en) | Programmable controller with 5-stage pipeline structure | |
JP4702004B2 (en) | Microcomputer | |
JPS62269237A (en) | Data processor | |
JPH03164945A (en) | Data processor |