JP2010033323A - Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor - Google Patents
Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor Download PDFInfo
- Publication number
- JP2010033323A JP2010033323A JP2008194830A JP2008194830A JP2010033323A JP 2010033323 A JP2010033323 A JP 2010033323A JP 2008194830 A JP2008194830 A JP 2008194830A JP 2008194830 A JP2008194830 A JP 2008194830A JP 2010033323 A JP2010033323 A JP 2010033323A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- cpu
- cpus
- multiprocessor
- debugging
- 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.)
- Withdrawn
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
複数のCPU(Central Processing Unit)をコアとして内蔵したマルチプロセッサ及びそれをデバッグするデバッグ装置並びに前記マルチプロセッサをデバッグするデバッグ方法に関する。 The present invention relates to a multiprocessor including a plurality of CPUs (Central Processing Units) as a core, a debugging apparatus for debugging the multiprocessor, and a debugging method for debugging the multiprocessor.
近年、LSI(Large Scale Integration)の処理能力を向上させるために、1チップ内に複数のCPUコアを内蔵するマルチプロセッサ構成を取るものが多くなってきた。複数のCPUコアを含むプロセッサのデバッグにおいては、複数のCPUコアが同期して動作しているため、それぞれのCPUコアで実行しているプログラムの時系列に従ってデバッグを行うことが必要である。デバッグの際にはプログラマーの意図通り動作していないCPUコアがある場合には、対象となるCPUコアのプログラム上にブレークポイントを設定し、そこで各CPUコアをプログラム実行状態からモニター状態と呼ばれるデバッグモードに移行させ、その近傍で1命令ずつステップ実行動作を行わせながらレジスタやメモリに格納されている値をチェックしていくということが行われている。 In recent years, in order to improve the processing capability of LSI (Large Scale Integration), many have adopted a multiprocessor configuration in which a plurality of CPU cores are built in one chip. In debugging a processor including a plurality of CPU cores, since the plurality of CPU cores operate synchronously, it is necessary to perform debugging in accordance with a time series of programs executed in the respective CPU cores. When there is a CPU core that does not operate as intended by the programmer during debugging, a breakpoint is set on the program of the target CPU core, and each CPU core is debugged from the program execution state to the monitor state. The mode is shifted to the mode, and the value stored in the register or the memory is checked while performing the step execution operation one instruction at a time in the vicinity thereof.
複数のコアを同時にモニター状態へ移行させることに関しては、特許文献1ないし特許文献5などに開示されている。
また、マルチプロセッサ構成において、命令を1命令ずつ実行していくステップ実行については特許文献6に開示されている。特許文献6には、複数のCPUコアの動作周波数が異なる場合に、周波数に反比例させた命令数を実行させることで複数のCPUコアを同時にステップ実行可能としていることが記載されている。
しかしながら、RISC(Reduced Instruction Set Computer)プロセッサにおいては遅延分岐や遅延ロードというパイプライン構成があり、この遅延分岐や遅延ロードはデスティネーションレジスタの更新が1サイクル以上遅延するために、ステップ実行している命令が遅延分岐もしくは遅延ロードを伴う命令である場合はプログラム通りにレジスタの値が更新しなくなるという問題がある。 However, a RISC (Reduced Instruction Set Computer) processor has a pipeline structure such as a delay branch and a delay load, and this delay branch and delay load are executed in steps because the destination register update is delayed by one cycle or more. If the instruction is an instruction with a delayed branch or delayed load, there is a problem that the value of the register is not updated according to the program.
上述した問題を図7ないし図9を参照して詳細に説明する。図7ないし図9は、最も代表的なプロセッサのパイプラインの流れを示している。つまり、命令フェッチ(Instruction Fetch)、命令デコード(Instruction Decode)およびレジスタ読み出し(Register Read)、演算(Execute)、メモリアクセス(Memory Access)、レジスタ書き込み(Write Back)の5段階で構成されている。 The above problem will be described in detail with reference to FIGS. 7 to 9 show the pipeline flow of the most typical processor. That is, it is composed of five stages of instruction fetch (Instruction Fetch), instruction decode (Instruction Decode) and register read (Register Read), operation (Execute), memory access (Memory Access), and register write (Write Back).
図7ないし図9のパイプラインを持つプロセッサにおいて、例えば、以下のような連続する3つの命令列がある場合を考える。
命令1:LD [add],R0(メモリのアドレスaddからデータをロードし、R0レジスタに格納する)
命令2:ADD R0,R1,R2(R0レジスタとR1レジスタの和をR2レジスタに格納する)
命令3:ADD R0,R3,R4(R0レジスタとR3レジスタの和をR4レジスタに格納する)
In the processor having the pipeline of FIGS. 7 to 9, for example, consider a case where there are three consecutive instruction sequences as follows.
Instruction 1: LD [add], R0 (load data from memory address add and store in R0 register)
Instruction 2: ADD R0, R1, R2 (store the sum of the R0 and R1 registers in the R2 register)
Instruction 3: ADD R0, R3, R4 (the sum of the R0 and R3 registers is stored in the R4 register)
上述した命令列は、図7に示すように実行していくことになるが、命令1でR0レジスタに値が格納されるよりも前に命令2、命令3でR0レジスタの読み出しを行うため、データハザードと呼ばれるパイプライン障害が発生する。命令3ではメモリから読み出した値を直接ALUに供給するForwardingと呼ばれるバイパス経路を開いて対応するが、命令2は絶対に間に合わないため更新前の値をR0レジスタの値として演算を行うことになる。つまり命令1(LD命令)はデスティネーションレジスタの更新が1サイクルの遅延を持っている命令であると言える。RISCプロセッサでは動作速度の向上のために、この状況をプログラムのスケジューリングに委ね、ハードウェアでは解決しないということが行われている。これを遅延ロードと呼ぶ。つまりこの場合プログラマーは、命令2は命令1によって更新される前のR0レジスタの値を使って演算を行うことを期待してプログラムを作成しているということになる。
The above-described instruction sequence is executed as shown in FIG. 7, but since the value is stored in the R0 register by the
ここで命令1をステップ実行する場合を説明する。ステップ実行は、対象となる命令(この場合命令1)の次の命令(命令2)をデバッグ装置のホストコンピュータ上に退避しておき、これをソフトウェアブレーク命令(EBRK命令)に差し替えることで実現されるが、ステップ実行の場合は図8に示すように命令1はパイプラインの最後まで実行されて停止するために、次の命令2をステップ実行する際にはR0レジスタの値が更新されてしまい、プログラム通りにデバッグ出来ないことになる。遅延分岐の場合も同様にステップ実行がプログラム通りに行われない。
Here, the case where the
このような問題を回避するためにチップの中に1つしかCPUコアがないプロセッサでは、ステップ実行の際に命令2をEBRK命令に差し替えるのではなく、図9のように命令3をEBRK命令に差し替えることでこの問題を回避している。
In order to avoid such a problem, a processor having only one CPU core in the chip does not replace
しかし1つのチップの中に複数のCPUコアがあるようなマルチプロセッサにおいて、各コアが独立してこの回避策を取ってしまうと、遅延ロード、遅延分岐を含む命令を実行しているCPUコアと、そうでないCPUコアとで同時にステップ実行を行うことが出来ないという問題があった。 However, in a multiprocessor having a plurality of CPU cores in one chip, if each core takes this workaround independently, a CPU core executing an instruction including a delay load and a delay branch There was a problem that step execution could not be performed simultaneously with other CPU cores.
本発明はかかる問題を解決することを目的としている。 The present invention aims to solve such problems.
すなわち、本発明は、1つのチップの中に複数のCPUコアがある場合でも、各CPUコアが同期してプログラムどおりの動作となるステップ実行を行うことができるマルチプロセッサ及びそれをデバッグするデバッグ装置並びに前記マルチプロセッサをデバッグするデバッグ方法を提供することを目的としている。 That is, the present invention relates to a multiprocessor capable of performing step execution in which each CPU core operates in synchronization with a program even when there are a plurality of CPU cores in one chip, and a debugging device for debugging the same. It is another object of the present invention to provide a debugging method for debugging the multiprocessor.
請求項1に記載された発明は、ブレーク命令によって実行状態からモニター状態に遷移し、同一周波数で動作するCPUを複数有するマルチプロセッサにおいて、前記複数のCPUそれぞれで実行している命令を監視する監視手段と、前記CPUに前記ブレーク命令が入力されている際に、前記監視手段が全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させる遷移手段と、を有していることを特徴とするマルチプロセッサである。 According to the first aspect of the present invention, in a multiprocessor having a plurality of CPUs operating at the same frequency by transitioning from an execution state to a monitor state by a break instruction, monitoring that monitors instructions executed by each of the plurality of CPUs And when the monitoring means detects that all of the CPUs are executing instructions that can transition to the monitor state when the break instruction is input to the CPU, the CPUs And a transition means for transitioning to the monitor state.
請求項2に記載された発明は、請求項1に記載された発明において、前記遷移手段が、前記CPUに含まれていることを特徴とするものである。
The invention described in
請求項3に記載された発明は、請求項1または2に記載された発明において、前記複数のCPUのうちから前記モニター状態に遷移するCPUを選択する選択手段を有していることを特徴とするものである。
The invention described in
請求項4に記載された発明は、ブレーク命令によって実行状態からモニター状態に遷移し、同一周波数で動作するCPUを複数有するマルチプロセッサと、前記マルチプロセッサをデバッグするデバッグ手段と、を有するデバッグ装置において、前記複数のCPUそれぞれで実行している命令を監視する監視手段と、前記CPUに前記ブレーク命令が入力されている際に、前記監視手段が全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させる遷移手段と、を有していることを特徴とするデバッグ装置である。 According to a fourth aspect of the present invention, there is provided a debugging apparatus comprising: a multiprocessor having a plurality of CPUs that transition from an execution state to a monitor state by a break instruction and operating at the same frequency; and a debugging unit that debugs the multiprocessor. Monitoring means for monitoring instructions executed by each of the plurality of CPUs; and when the break instruction is input to the CPU, the monitoring means provides instructions that allow all of the CPUs to transition to a monitor state. And a transition unit configured to transition the plurality of CPUs to the monitor state when the execution is detected.
請求項5に記載された発明は、ブレーク命令によって実行状態からモニター状態に遷移し、同一周波数で動作するCPUを複数有するマルチプロセッサをデバッグするデバッグ方法において、前記複数のCPUそれぞれで実行している命令を監視し、前記CPUに前記ブレーク命令が入力されている際に、全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させることを特徴とするデバッグ方法である。 According to a fifth aspect of the present invention, in a debugging method for debugging a multiprocessor having a plurality of CPUs operating at the same frequency by transitioning from an execution state to a monitoring state by a break instruction, each of the plurality of CPUs executes the debugging method. The instruction is monitored, and when the break instruction is input to the CPU, if it is detected that all the CPUs are executing an instruction that can transition to the monitor state, the plurality of CPUs are monitored. This is a debugging method characterized by transitioning to a state.
請求項1に記載の発明によれば、監視手段で複数のCPUそれぞれで実行している命令を監視し、CPUにブレーク命令が入力されている際に、監視手段が全てのCPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、複数のCPUをモニター状態に遷移させているので、複数のCPUの中でステップ実行中の命令が遅延分岐や遅延ロードなどモニター状態に移行することでプログラム通りの動きを再現できないような命令であるものが1つでもある場合には、モニター状態に移行せずに次の命令を実行するようにすることで、全てのCPUが同期してモニター状態に遷移することができるので、プログラム通りの動きを再現できるステップ実行をすることができる。また、ハードウェアで制御しているので、ステップ実行時のデバッグ用ホストコンピュータの処理の負荷を軽減することができる。 According to the first aspect of the present invention, the monitoring unit monitors the instruction executed by each of the plurality of CPUs, and when the break instruction is input to the CPU, the monitoring unit sets all the CPUs to the monitor state. If it is detected that a transitionable instruction is being executed, multiple CPUs are transitioned to the monitor state, so that the instruction being stepped in the multiple CPUs is placed in the monitor state such as delayed branch or delayed load. If there is even one command that cannot be reproduced as programmed by shifting, all the CPUs are synchronized by executing the next command without shifting to the monitor state. Thus, it is possible to perform step execution that can reproduce the movement according to the program. In addition, since it is controlled by hardware, the processing load of the debugging host computer during step execution can be reduced.
請求項2に記載の発明によれば、遷移手段が、CPUに含まれているので、監視手段と遷移手段との間の配線が短くなり高速に動作させる際に有利となる。 According to the second aspect of the present invention, since the transition means is included in the CPU, the wiring between the monitoring means and the transition means is shortened, which is advantageous when operating at high speed.
請求項3に記載の発明によれば、複数のCPUのうちからモニター状態に遷移するCPUを選択する選択手段を有しているので、他のCPUとの依存関係の無い物を除外することができ、それによってステップ実行を行う際の1ステップの命令数を少なくすることができる。 According to the third aspect of the present invention, since there is a selection means for selecting a CPU that transitions to a monitor state from among a plurality of CPUs, it is possible to exclude an object having no dependency relationship with other CPUs. Thus, the number of instructions in one step when performing step execution can be reduced.
請求項4に記載の発明によれば、監視手段で複数のCPUそれぞれで実行している命令を監視し、CPUにブレーク命令が入力されている際に、監視手段が全てのCPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、複数のCPUをモニター状態に遷移させているので、複数のCPUの中でステップ実行中の命令が遅延分岐や遅延ロードなどモニター状態に移行することでプログラム通りの動きを再現できないような命令であるものが1つでもある場合には、モニター状態に移行せずに次の命令を実行するようにすることで、全てのCPUが同期してモニター状態に遷移することができるので、プログラム通りの動きを再現できるステップ実行をすることができる。 According to the fourth aspect of the present invention, the monitoring unit monitors the instruction executed by each of the plurality of CPUs, and when the break instruction is input to the CPU, the monitoring unit sets all the CPUs to the monitor state. If it is detected that a transitionable instruction is being executed, multiple CPUs are transitioned to the monitor state, so that the instruction being stepped in the multiple CPUs is placed in the monitor state such as delayed branch or delayed load. If there is even one command that cannot be reproduced as programmed by shifting, all the CPUs are synchronized by executing the next command without shifting to the monitor state. Thus, it is possible to perform step execution that can reproduce the movement according to the program.
請求項5に記載の発明によれば、複数のCPUそれぞれで実行している命令を監視し、CPUにブレーク命令が入力されている際に、全てのCPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、複数のCPUをモニター状態に遷移させているので、複数のCPUの中でステップ実行中の命令が遅延分岐や遅延ロードなどモニター状態に移行することでプログラム通りの動きを再現できないような命令であるものが1つでもある場合には、モニター状態に移行せずに次の命令を実行するようにすることで、全てのCPUが同期してモニター状態に遷移することができるので、プログラム通りの動きを再現できるステップ実行をすることができる。 According to the fifth aspect of the present invention, the instruction executed by each of the plurality of CPUs is monitored, and when a break instruction is input to the CPU, all the CPUs execute an instruction that can transit to the monitor state. If it is detected that a plurality of CPUs are in the monitor state, the instructions being executed in steps in the plurality of CPUs are shifted to the monitor state such as delayed branching and delay load, and the program is executed. If there is at least one command that cannot reproduce the movement of the CPU, the next command is executed without shifting to the monitor state, so that all CPUs shift to the monitor state synchronously. Therefore, it is possible to perform step execution that can reproduce the motion as programmed.
[第1実施形態]
以下、本発明の第1の実施形態を、図1ないし図3を参照して説明する。図1は、本発明の第1の実施形態にかかるマルチプロセッサのブロック図である。図2は、図1に示したマルチプロセッサの変形例を示したブロック図である。図3は、図1に示したマルチプロセッサのチップレイアウトの例を示した説明図である。
[First Embodiment]
A first embodiment of the present invention will be described below with reference to FIGS. FIG. 1 is a block diagram of a multiprocessor according to the first embodiment of the present invention. FIG. 2 is a block diagram showing a modification of the multiprocessor shown in FIG. FIG. 3 is an explanatory diagram showing an example of the chip layout of the multiprocessor shown in FIG.
図1に示したマルチプロセッサ1は、CPU2a、2b、2cと、ブレーク生成装置3と、を備え、1チップのLSIで構成されている。
The
CPU(CPUコア、コアCPU或いは単にコアともいう)2aは、デコーダ21、AND回路22、23と、を備えている。また、CPU2aは、図示しないが、プログラム格納用のプログラムRAM、演算データ格納用のデータRAM、プログラムのアドレスを保持するプログラムカウンタ、プログラムRAMから読み出した命令を格納する命令レジスタ、演算回路および各種レジスタも備えている。なお、CPU2b、2cも同様の構成である。また、CPU2a、2b、2cは同一周波数のクロックで動作する。
The CPU (also referred to as CPU core, core CPU, or simply core) 2 a includes a
監視手段としてのデコーダ21は、命令レジスタに格納された命令をデコードするデコーダであり、本実施形態では、モニター状態に遷移できる命令である場合はモニター遷移移行可能信号を出力する。モニター状態とは、プログラムを実行している状態である実行状態から遷移する状態であり、この状態でプログラムのステップ実行やデータメモリなどの読み出しなどのデバッグを行うことができる。また、モニター状態に遷移できる命令とは、CPU2a、2b、2cに実装されている命令のうち遅延ロード、遅延分岐を伴う命令以外の命令を示す。
The
遷移手段としてのAND回路22は、CPU2a、2b、2cのモニター遷移可能信号の論理積をとって、全てのモニター遷移可能信号がアクティブ(例えばハイレベル)になるとアクティブレベルの信号(例えばハイレベル)を出力する。
The AND
遷移手段としてのAND回路23は、後述するブレーク生成装置3から出力されるハードウェアブレーク信号とAND回路22の出力との論理積をとって、双方ともアクティブ(例えばハイレベル)になると出力であるモニター状態移行信号をアクティブ(例えばハイレベル)とする。
The AND
ブレーク生成装置3は、マルチプロセッサ1の外部などからの信号などによってハードウェアブレーク信号を生成し出力する。
The
次に、図1に示したマルチプロセッサ1におけるステップ動作を説明する。説明を平易にするためにCPU2a、2bをステップ実行する場合について説明することとし、一例として以下のプログラムでそれぞれ命令1をステップ実行する場合を考える。
Next, the step operation in the
CPU2aのプログラム
命令1:LD [add],R0(メモリのアドレスaddからデータをロードし、R0レジスタに格納する)
命令2:ADD R0,R1,R2(R0レジスタとR1レジスタの和をR2レジスタに格納する)
命令3:ADD R0,R3,R4(R0レジスタとR3レジスタの和をR4レジスタに格納する)
命令4:NOP(何もしない)
CPU2a program instruction 1: LD [add], R0 (load data from memory address add and store in R0 register)
Instruction 2: ADD R0, R1, R2 (store the sum of the R0 and R1 registers in the R2 register)
Instruction 3: ADD R0, R3, R4 (the sum of the R0 and R3 registers is stored in the R4 register)
Command 4: NOP (do nothing)
CPU2bのプログラム
命令1:LD [add],R0(メモリのアドレスaddからデータをロードし、R0レジスタに格納する)
命令2:LD [add],R1(メモリのアドレスaddからデータをロードし、R1レジスタに格納する)
命令3:ADD R1,R6,R7(R1レジスタとR6レジスタの和をR7レジスタに格納する)
命令4:ADD R1,R9,R10(R1レジスタとR9レジスタの和をR10レジスタに格納する)
CPU2b program instruction 1: LD [add], R0 (load data from memory address add and store in R0 register)
Instruction 2: LD [add], R1 (load data from memory address add and store in R1 register)
Instruction 3: ADD R1, R6, R7 (the sum of the R1 register and R6 register is stored in the R7 register)
Instruction 4: ADD R1, R9, R10 (store the sum of the R1 and R9 registers in the R10 register)
まず命令1をそれぞれのCPUのデコーダ21でデコードすると、CPU2a、CPU2bともに遅延ロード命令であるためモニター遷移可能信号はアクティブとならない。次に命令2をそれぞれのCPUのデコーダ21でデコードするとCPU2aは遅延ロードでも遅延分岐でもないのでCPU2aのモニター遷移可能信号はアクティブとなるが、CPU2bが遅延ロード命令であるためCPU2bのモニター遷移可能信号はアクティブとならない。従ってAND回路22の出力はアクティブとならない。命令1をステップ実行する場合この命令2のタイミングでハードウェアブレーク信号がアクティブとなる。次の命令3をそれぞれのCPUのデコーダ21でデコードすると、CPU2a、CPU2bともに遅延ロードでも遅延分岐でもないため、それぞれのモニター遷移可能信号がアクティブとなってAND回路22がアクティブとなり、ハードウェアブレーク信号がアクティブであるためAND回路23がアクティブとなって命令4のタイミングでCPU2a、CPU2bともにブレーク(停止)する。
First, when the
こうするとCPU2aもCPU2bも命令1〜3を実行した後にモニター状態に遷移するため、プログラム通りにステップ実行を行うことができる。
In this way, since both the
本実施形態のように、CPUをブレークさせるための信号がハードウェアとして装備されており、その信号をプロセッサに印加することによって実行状態からモニター状態へ移行することをハードウェアブレークといい、ハードウェアブレーク信号が特許請求の範囲のブレーク命令に相当する。 As in this embodiment, a signal for breaking the CPU is provided as hardware, and the transition from the execution state to the monitoring state by applying the signal to the processor is called a hardware break. The break signal corresponds to a break instruction in the claims.
本実施形態によれば、CPU2a、CPU2b、CPU2cを内蔵したマルチプロセッサ1において、ステップ動作時にモニター状態に遷移させるために、CPU2a、CPU2b、CPU2cそれぞれの命令をデコーダ21でデコードして、モニター状態に遷移可能な命令の場合はモニター遷移可能信号を出力し、全てのCPUがモニター遷移可能信号を出力した場合に、各CPUをモニター状態に遷移させているので、プログラム通りの動きを再現できるステップ実行をすることができる。
According to the present embodiment, in the
また、マルチプロセッサ1内部でモニター状態への遷移をハード的に制御しているので、ステップ実行時のデバッグ用ホストコンピュータの処理の負荷を軽減することができる。さらに、ハードウェアブレークを用いているので、各CPUのプログラムメモリからのデータを読み出して各CPUのプログラムメモリの書き換えといった作業が不要となるためステップ実行が高速化できる。
In addition, since the transition to the monitor state is controlled by hardware in the
なお、AND回路22およびAND回路23は、CPU2a、2b、2cがそれぞれ内蔵せずに、図2に示すようにブレーク生成装置3で一括して論理積をとってモニター遷移信号を生成してCPU2a、2b、2cに出力する構成としてもよい。
Note that the AND
このように構成することで、ブレーク生成装置3で一括して論理積をとってモニター遷移信号を生成してCPU2a、2b、2cに出力しているので、CPU2a、2b、2cに対する回路変更が最小限で済む。
With this configuration, the
ただし、図2よりも図1の構成のほうが、各CPUとAND回路との間の配線が短くなるために高速に動作させる際に有利である。一般的にLSIのチップレイアウトの際には図3に示すようにCPU2a、2b、2cは並べて配置されることが多い。一方、ブレーク生成装置3のようなデバッグ回路は、通常動作に関わらないことや外部との通信を行うことからCPU2a、2b、2cとは離れた外周に配置される可能性が大きい。この場合、各CPUとブレーク生成装置3との間の配線が長くなり、図2のように各CPUから信号を取り出してからまた各CPUに信号を出力する構成では、図1と比較して回路の高速化が困難である。従って、ハードウェアで各CPUをブレークさせる際には図1の構成の方が好ましい。
However, the configuration shown in FIG. 1 is more advantageous than the configuration shown in FIG. 2 because the wiring between each CPU and the AND circuit is shortened. In general, in the LSI chip layout, the
[第2実施形態]
次に、本発明の第2の実施形態を図4を参照して説明する。なお、前述した第1の実施形態と同一部分には、同一符号を付して説明を省略する。図4は、本発明の第2の実施形態にかかるマルチプロセッサのブロック図である。
[Second Embodiment]
Next, a second embodiment of the present invention will be described with reference to FIG. Note that the same parts as those in the first embodiment described above are denoted by the same reference numerals and description thereof is omitted. FIG. 4 is a block diagram of a multiprocessor according to the second embodiment of the present invention.
本実施形態では、選択手段としてのブレーク生成装置3が、ハードウェアブレーク信号に加えて、CPU2aマスク信号、CPU2bマスク信号、CPU2cマスク信号を出力している。
In the present embodiment, the
さらに、CPU2aでは、CPU2bマスク信号とCPU2bが出力したモニター遷移可能信号とがOR回路24によって論理和をとってAND回路22に入力され、CPU2cマスク信号とCPU2cが出力したモニター遷移可能信号とがOR回路25によって論理和をとってAND回路22に入力されている。CPU2bでは、CPU2aマスク信号とCPU2aが出力したモニター遷移可能信号とがOR回路24によって論理和をとってAND回路22に入力され、CPU2cマスク信号とCPU2cが出力したモニター遷移可能信号とがOR回路25によって論理和をとってAND回路22に入力されている。CPU2cでは、CPU2aマスク信号とCPU2aが出力したモニター遷移可能信号とがOR回路24によって論理和をとってAND回路22に入力され、CPU2bマスク信号とCPU2bが出力したモニター遷移可能信号とがOR回路25によって論理和をとってAND回路22に入力されている。
Further, in the
このような構成にすることで同期して動かなくても構わないCPUを除外してステップ実行が可能となる。例えば、CPU2aを除外する場合、CPU2aマスク信号をアクティブ(ハイレベル)にする。そうすると、CPU2bとCPU2cではOR回路24によってAND回路22の入力が常にアクティブ(ハイレベル)となるので、CPU2aの状態に関わらずCPU2bと2cとでステップ実行を行うことができる。すなわち、ブレーク生成装置3が出力するCPU2aマスク信号、CPU2bマスク信号、CPU2cマスク信号によってモニター状態に遷移するCPUを選択している。
By adopting such a configuration, it is possible to perform step execution by excluding CPUs that do not have to operate synchronously. For example, when excluding the
本実施形態によれば、ブレーク生成装置3が各CPUに対してマスク信号(CPU2aマスク信号、CPU2bマスク信号、CPU2cマスク信号)を出力して、各CPUでは他のCPUからのモニター遷移可能信号とマスク信号の論理和を取った上で、自身の信号と論理積を取るように構成しているので、他のCPUとの依存関係の無い物を除外することができ、それによって除外したCPUがモニター状態に遷移できない命令を実行中であってもモニター状態にさせることができ、全てのCPUを同期してステップ実行する場合と比較してステップ実行を行う際の1ステップの命令数を少なくすることができる。
According to the present embodiment, the
[第3の実施形態]
次に、本発明の第3の実施形態を図5および図6を参照して説明する。なお、前述した第1、第2の実施形態と同一部分には、同一符号を付して説明を省略する。図5は、本発明の第3の実施形態にかかるデバッグ装置のブロック図である。図6は、図5に示したデバッグ装置のステップ実行動作を示すフローチャートである。
[Third Embodiment]
Next, a third embodiment of the present invention will be described with reference to FIGS. The same parts as those in the first and second embodiments described above are denoted by the same reference numerals and description thereof is omitted. FIG. 5 is a block diagram of a debugging device according to the third embodiment of the present invention. FIG. 6 is a flowchart showing the step execution operation of the debugging apparatus shown in FIG.
図5に示したデバッグ装置10は、マルチプロセッサ1´と、ブレーク生成装置3´と、を備えている。
The
マルチプロセッサ1´は、CPU2a´、2b´、2c´を備えている。CPU2a´、2b´、2c´は、デコーダ21や、図示しないプログラム格納用のプログラムRAM、演算データ格納用のデータRAM、プログラムのアドレスを保持するプログラムカウンタ、プログラムRAMから読み出した命令を格納する命令レジスタ、演算回路および各種レジスタを備えている点は第1、第2の実施形態のCPU2a、2b、2cと同様であるが、AND回路22および23が削除されている点が異なる。
The
さらに、マルチプロセッサ1´は第1、第2の実施形態において、内蔵されていたブレーク生成装置3が削除され、マルチプロセッサ1´外部にブレーク生成装置3´として設けられている。この監視手段、遷移手段としてのブレーク生成装置は、例えばデバッグ用のコンピュータやワークステーションなどで構成してもよい。
Furthermore, in the first and second embodiments, the built-in
次に、上述した構成のデバッグ装置10において、ステップ実行を行う際の動作を図6のフローチャートを参照して説明する。図6に示したフローチャートはブレーク実行装置3´にて実行される。
Next, the operation when performing step execution in the
まず、ステップS1において、検査対象となる命令を各CPUのプログラムカウンタ位置の命令に設定しステップS2に進む。本ステップでは、各CPUのプログラムをプログラムメモリからブレーク生成装置3´に読み出して、ステップ実行する命令をプログラムカウンタに設定された状態としている。 First, in step S1, an instruction to be inspected is set as an instruction at the program counter position of each CPU, and the process proceeds to step S2. In this step, the program of each CPU is read from the program memory to the break generation device 3 ', and the instruction to be executed in step is set in the program counter.
次に、ステップS2において、全CPUにおいて対象命令をチェックしてステップS3に進む。本ステップにおいては、モニター状態に遷移できる命令であるか否かをチェックしている。 Next, in step S2, the target instruction is checked in all the CPUs, and the process proceeds to step S3. In this step, it is checked whether or not the command is capable of transitioning to the monitor state.
次に、ステップS3において、全てのCPUがモニター状態に遷移可能か否かを判断して遷移可能である場合(YESの場合)はステップS5に進み、遷移可能でない場合(NOの場合)はステップS4に進む。つまり、ステップS2でチェックした命令がモニター状態に遷移可能か否かを判断している。 Next, in step S3, it is determined whether or not all CPUs can transition to the monitor state, and if transition is possible (in the case of YES), the process proceeds to step S5. Proceed to S4. That is, it is determined whether or not the instruction checked in step S2 can transition to the monitor state.
次に、ステップS4において、全てのCPUがモニター状態に遷移可能な命令でなかったため、対象命令を1つ次の命令に進めてステップS2に戻る。 Next, in step S4, since all the CPUs are not instructions that can make a transition to the monitor state, the target instruction is advanced to the next instruction and the process returns to step S2.
次に、ステップS5において、全てのCPUがモニター状態に遷移可能な命令であったため、対象命令の1つ次の命令を退避してステップS6に進む。 Next, in step S5, since all the CPUs are instructions that can transition to the monitor state, the instruction next to the target instruction is saved and the process proceeds to step S6.
次に、ステップS6において、対象命令の1つ次の命令をソフトウェアブレーク命令(EBRK命令)に修正しステップS7に進む。本ステップにおいて、ステップS5で退避した命令に代えてソフトウェアブレーク命令に差し替える。 Next, in step S6, the instruction next to the target instruction is corrected to a software break instruction (EBRK instruction), and the process proceeds to step S7. In this step, a software break instruction is substituted for the instruction saved in step S5.
次に、ステップS7において、全てのCPUをプログラム実行状態にする。本ステップにおいて、修正したプログラムを各CPUのプログラムメモリに書き込んでプログラムを実行させている。そして、実行されたプログラムはEBRK命令をデコーダ21がデコードすることでモニター遷移可能信号を出力してCPUを停止させ、以後モニター状態に遷移してステップ実行を行うことができる。
Next, in step S7, all the CPUs are set to the program execution state. In this step, the modified program is written in the program memory of each CPU and the program is executed. The executed program causes the
上述したフローチャートの動作例を第1の実施形態で例示したプログラムでそれぞれ命令1をステップ実行する場合で説明する。まず命令1をそれぞれ検査すると、CPU2a´、CPU2b´ともに遅延ロード命令であるためスキップする。次に命令2をそれぞれ検査するとCPU2a´は遅延ロードでも遅延分岐でもないが、CPU2b´が遅延ロード命令であるためスキップする。次の命令3をそれぞれ検査すると、CPU2a´、CPU2b´ともに遅延ロードでも遅延分岐でもないため、それぞれ次の命令4をソフトウェアブレーク命令(EBRK命令)に差し替える。
An operation example of the above-described flowchart will be described in the case where the
本実施形態のように、ブレークしたい箇所の命令を、EBRK命令に置き換えて、モニター状態への移行をプロセッサの命令デコーダに委ねて、モニターモードへ移行することをソフトウェアブレークといい、このEBRK命令が特許請求の範囲のブレーク命令に相当する。 As in this embodiment, replacing an instruction at a place where a break is desired with an EBRK instruction, leaving the transition to the monitor state to the instruction decoder of the processor and shifting to the monitor mode is called a software break, and this EBRK instruction This corresponds to the break instruction in the claims.
本実施例によれば、デバッグ装置10において、ステップ動作時にモニター状態に遷移させるために、ブレーク生成装置3´でマルチプロセッサ1´内のCPU2a´、2b´、2c´のプログラムをそれぞれ読み込んで、実行するべき命令を検査し、全てのCPUでその命令が遅延ロード、遅延分岐命令ではなければ次の命令を退避し、ソフトウェアブレーク命令に差し替えた後、全てのCPUを同時にプログラム実行状態にする。もしも1つでも遅延ロードや遅延分岐命令がある場合には全てのCPUでその命令をスキップして次の命令を検査するということを遅延ロード、遅延分岐命令が出なくなるまで繰り返しているので、プログラム通りの動きを再現できるステップ実行をすることができる。
According to the present embodiment, the
また、ブレーク生成装置3´でソフトウェアブレーク命令に差し替えることでステップ実行を行わせているので、マルチプロセッサ1´に追加回路等が不要となる。 In addition, since step execution is performed by replacing the software break instruction with the break generation device 3 ', an additional circuit or the like is not required for the multiprocessor 1'.
また、上述した第3の実施形態では、遅延ロードである場合には直後の命令をEBRK命令に差し替えることが出来ないとして説明を行ったが、遅延ロードであってもデスティネーションが直後の命令のソースと異なる場合には、直後の命令をEBRK命令に差し替えても問題がないため、検査対象の命令だけではなく、直後の命令も考慮して判断を行うようにすればステップ実行の際の命令実行数を少なくすることが出来る。 Further, in the third embodiment described above, it has been described that the instruction immediately after cannot be replaced with the EBRK instruction in the case of a delay load. If it is different from the source, there is no problem even if the immediately following instruction is replaced with the EBRK instruction. Therefore, if the determination is made considering not only the instruction to be inspected but also the immediately following instruction, the instruction at the time of step execution The number of executions can be reduced.
なお、本発明は上記実施形態に限定されるものではない。即ち、本発明の骨子を逸脱しない範囲で種々変形して実施することができる。 The present invention is not limited to the above embodiment. That is, various modifications can be made without departing from the scope of the present invention.
1 マルチプロセッサ
2a、2b、2c CPU
21 デコーダ(監視手段)
22、23 AND回路(遷移手段)
24、25 OR回路(選択手段)
3 ブレーク生成装置(選択手段)
10 デバッグ装置(選択手段)
1´ マルチプロセッサ
2a´、2b´、2c´ CPU
3´ ブレーク生成装置(監視手段、遷移手段)
1
21 Decoder (monitoring means)
22, 23 AND circuit (transition means)
24, 25 OR circuit (selection means)
3 Break generation device (selection means)
10 Debugging device (selection means)
1 '
3 'Break generation device (monitoring means, transition means)
Claims (5)
前記複数のCPUそれぞれで実行している命令を監視する監視手段と、
前記CPUに前記ブレーク命令が入力されている際に、前記監視手段が全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させる遷移手段と、
を有していることを特徴とするマルチプロセッサ。 In a multiprocessor having a plurality of CPUs that transition from an execution state to a monitor state by a break instruction and operate at the same frequency,
Monitoring means for monitoring instructions executed by each of the plurality of CPUs;
When the break instruction is input to the CPU, if the monitoring unit detects that all the CPUs are executing an instruction that can transition to the monitor state, the plurality of CPUs are placed in the monitor state. Transition means for transitioning to
A multiprocessor characterized by comprising:
前記複数のCPUそれぞれで実行している命令を監視する監視手段と、
前記CPUに前記ブレーク命令が入力されている際に、前記監視手段が全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させる遷移手段と、
を有していることを特徴とするデバッグ装置。 In a debugging device having a multiprocessor having a plurality of CPUs that transition from an execution state to a monitor state by a break instruction and operate at the same frequency, and debugging means for debugging the multiprocessor,
Monitoring means for monitoring instructions executed by each of the plurality of CPUs;
When the break instruction is input to the CPU, if the monitoring unit detects that all the CPUs are executing an instruction that can transition to the monitor state, the plurality of CPUs are placed in the monitor state. Transition means for transitioning to
A debugging device characterized by comprising:
前記複数のCPUそれぞれで実行している命令を監視し、前記CPUに前記ブレーク命令が入力されている際に、全ての前記CPUがモニター状態に遷移可能な命令を実行していることを検出した場合は、前記複数のCPUを前記モニター状態に遷移させることを特徴とするデバッグ方法。 In a debugging method for debugging a multiprocessor having a plurality of CPUs operating at the same frequency by transitioning from an execution state to a monitor state by a break instruction,
An instruction executed by each of the plurality of CPUs is monitored, and when the break instruction is input to the CPU, it is detected that all the CPUs are executing an instruction that can transition to a monitor state. In this case, the debugging method is characterized by causing the plurality of CPUs to transition to the monitor state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008194830A JP2010033323A (en) | 2008-07-29 | 2008-07-29 | Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008194830A JP2010033323A (en) | 2008-07-29 | 2008-07-29 | Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010033323A true JP2010033323A (en) | 2010-02-12 |
Family
ID=41737719
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008194830A Withdrawn JP2010033323A (en) | 2008-07-29 | 2008-07-29 | Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010033323A (en) |
-
2008
- 2008-07-29 JP JP2008194830A patent/JP2010033323A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4996654B2 (en) | Processor | |
JP4865016B2 (en) | Processor | |
US20010023479A1 (en) | Information processing unit, and exception processing method for specific application-purpose operation instruction | |
US7676774B2 (en) | System LSI verification system and system LSI verification method | |
JPH0773037A (en) | Method and device for automatically generating instruction string for control mechanism verification of processor | |
JPWO2006022202A1 (en) | Information processing device, exception control circuit | |
JP2009175960A (en) | Virtual multiprocessor system | |
JP2000353092A (en) | Information processor and register file switching method for the processor | |
JP2010033323A (en) | Multiprocessor, debugging device for debugging the same, and debug method for debugging the multiprocessor | |
JP2013161484A (en) | Reconfigurable computing apparatus, first memory controller and second memory controller therefor, and method of processing trace data for debugging therefor | |
JP2007257349A (en) | Processor and processing method thereof | |
TW201734769A (en) | Processing vector instructions | |
JP2008140124A (en) | Data processor | |
JP5850732B2 (en) | Semiconductor device and control method thereof | |
JP7378254B2 (en) | multiprocessor device | |
JP4009461B2 (en) | Semiconductor device | |
WO2010109631A1 (en) | Information processing device, information processing method and information processing program | |
JP2002268876A (en) | Pipeline processing method and information processor | |
JP4151497B2 (en) | Pipeline processing equipment | |
JP3933679B2 (en) | Instruction processing device | |
JP2003108541A (en) | Processor, memory test method and memory test system | |
JP2002366378A (en) | Method and device for debugging program and storage medium | |
JP5718600B2 (en) | Information processing system and information processing method | |
JP2015014833A (en) | Reconfigurable lsi | |
JP2007213415A (en) | Memory device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20111004 |