JP2005250821A - Emulator and microprocessor - Google Patents

Emulator and microprocessor Download PDF

Info

Publication number
JP2005250821A
JP2005250821A JP2004060003A JP2004060003A JP2005250821A JP 2005250821 A JP2005250821 A JP 2005250821A JP 2004060003 A JP2004060003 A JP 2004060003A JP 2004060003 A JP2004060003 A JP 2004060003A JP 2005250821 A JP2005250821 A JP 2005250821A
Authority
JP
Japan
Prior art keywords
task
register
circuit
information
microprocessor
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
JP2004060003A
Other languages
Japanese (ja)
Inventor
Atsushi Takahashi
淳 高橋
Takuto Ishii
沢人 石井
Hiroshi Miyashita
浩 宮下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2004060003A priority Critical patent/JP2005250821A/en
Publication of JP2005250821A publication Critical patent/JP2005250821A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To enable a desired task to be debugged. <P>SOLUTION: An emulator comprises a microprocessor (20) capable of running a user program with task kind information incorporated therein; a first register (13) capable of storing the task writing destination address information set by a host system (71); a comparison circuit capable of comparing the address information output from the micro processor (20) and the address information in the first register; and a second register (17) capable of storing the task kind information on the basis of the comparison result from the comparison circuit. The comparison result between the address information output from the micro processor (20) and the address information stored in the first register (13) is stored in the second register (17). This second register (17) is made readable by the host system then the debug for the desired task is made possible. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、ユーザプログラムのデバッグ技術に関し、例えばエミュレータに適用して有効な技術に関する。   The present invention relates to a debugging technique for a user program, for example, a technique effective when applied to an emulator.

リアルタイムオペレーティングシステムを用いてタスクを起動する制御装置は、例えば特許文献1に記載されているように公知の技術とされる。   A control device that activates a task using a real-time operating system is a known technique as described in Patent Document 1, for example.

ところで、リアルタイムオペレーティングシステムにおいて、プログラム言語の1行毎の実行はステップ動作と称される。このステップ動作は次実行命令の種類により停止方法を変えることで実現している。ステップ動作の主な機能としては、ステップイン実行、ステップオーバー実行、ステップアウト実行が挙げられる。   By the way, in a real-time operating system, execution of a program language for each line is called a step operation. This step operation is realized by changing the stopping method according to the type of the next execution instruction. The main functions of the step operation include step-in execution, step over execution, and step out execution.

ステップイン実行は、現在の1命令が実行される動作とされる。関数にステップイン実行することを選択した場合には、デバッガは関数の行又は命令でコールが実行される。   Step-in execution is an operation in which the current one instruction is executed. If you choose to step into a function, the debugger executes the call at the function line or instruction.

ステップオーバー実行は、現在の行の1命令が実行される動作とされる。関数をステップオーバー実行することを選択した場合は、デバッガはコール及び関数内の全てのコード(及び関数が行う関数コールのすべて)を実行して、呼び出し関数の次の行又は命令で停止される。   Step over execution is an operation in which one instruction on the current line is executed. If you choose to step over the function, the debugger executes the call and all the code in the function (and all the function calls that the function makes) and stops at the next line or instruction of the calling function .

ステップアウト実行は、関数内の残りのコードステップ実行せずに呼び出して元の関数に戻る動作とされる。   Step-out execution is an operation that returns to the original function by calling without executing the remaining code steps in the function.

特開平10−105416号公報(図13他)JP-A-10-105416 (FIG. 13 and others)

従来のタスク別ステップでは、タスク種別のチェックができないために、1行毎のステップ動作ではリアルタイムオペレーティングシステム内や、他のタスク内でステップ動作が停止され、所望のタスク内にのみ着目したステップ動作が不可能になることが、本願発明者によって見いだされた。例えば、タスク1からリアルタイムオペーティングシステムに遷移した後に、上記タスク1とは異なるタスク2に遷移され、さらにそこからリアルタイムオペーティングシステムに遷移した後に、再びタスク1に遷移するようなユーザプログラムにおいて、タスク1のみのデバッグを行いたいにもかかわらず、リアルタイムオペーティングシステムやタスク2においてステップ動作が停止され、その結果、上記リアルタイムオペーティングシステムから遷移されたタスク1についてのデバッグを行うことができなくなる。   In conventional task-specific steps, the task type cannot be checked, so in the step operation for each line, the step operation is stopped in the real-time operating system or in other tasks, and the step operation focused only on the desired task It has been found by the present inventors that this is impossible. For example, a user program that transits from task 1 to a real-time operating system, then transits to task 2 different from task 1, and then transits from there to a real-time operating system and then transits to task 1 again. However, although the task 1 only needs to be debugged, the step operation is stopped in the real-time operating system or task 2, and as a result, the task 1 transitioned from the real-time operating system is debugged. I can't do that.

本発明の目的は、ユーザプログラムのデバッグにおいてタスク種別を取得することにより所望のタスクについてのデバッグを可能とするための技術を提供する。   An object of the present invention is to provide a technique for enabling debugging of a desired task by acquiring a task type in debugging a user program.

また本発明の別の目的は、ステップ動作、トレース情報取得、パフォーマンス測定、及びブレーク動作をそれぞれタスク種別で可能とするための技術を提供することにある。   Another object of the present invention is to provide a technique for enabling step operations, trace information acquisition, performance measurement, and break operations for each task type.

さらに本発明の別の目的はデバッグ効率の向上を図ることにある。   Another object of the present invention is to improve debugging efficiency.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

すなわち、タスク種別情報が組み込まれたユーザプログラムを実行可能なマイクロプロセッサと、ホストシステムによって設定されたタスク書き込み先アドレス情報を保持可能な第1レジスタと、上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較可能な比較回路と、上記比較回路の比較結果に基づいてタスク種別情報を保持可能な第2レジスタと、を含んでエミュレータを構成する。このとき、上記第2レジスタは上記ホストシステムによって読み出し可能にされる。   That is, a microprocessor capable of executing a user program in which task type information is incorporated, a first register capable of holding task write destination address information set by a host system, and the user program being executed by the microprocessor A comparison circuit that can compare the address information output from the microprocessor with the address information held in the first register, and a task type information that can hold task type information based on the comparison result of the comparison circuit. The emulator includes two registers. At this time, the second register can be read by the host system.

上記の手段によれば、比較回路は、上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較し、その比較結果が第2レジスタに保持される。この第2レジスタはホストシステムによって読み出し可能とされるため、ホストシステムは、上記第2レジスタの保持情報に基づいて特定タスクのみのステップ制御が可能とされる。このことが、ユーザプログラムのデバッグにおいてタスク種別を取得することにより所望のタスクについてのデバッグを可能にする。   According to the above means, the comparison circuit compares the address information output from the microprocessor when the user program is executed by the microprocessor and the address information held in the first register. The comparison result is held in the second register. Since the second register can be read by the host system, the host system can perform step control of only a specific task based on the information held in the second register. This makes it possible to debug a desired task by acquiring the task type in debugging the user program.

また、タスク種別情報が組み込まれたユーザプログラムを実行可能なマイクロプロセッサと、ホストシステムによって設定されたタスク書き込み先アドレス情報を保持可能な第1レジスタと、上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較可能な第1比較回路と、上記比較回路の比較結果に基づいてタスク種別情報を保持可能な第2レジスタと、複数の観測対象タスク種別情報を設定可能な第3レジスタと、上記第2レジスタの保持情報と上記第3レジスタの保持情報とを比較可能な第2比較回路と、上記第2レジスタの保持情報と上記第3レジスタの保持情報とが一致した場合にタスク状態信号を生成可能なタスク状態信号生成回路と、上記タスク状態信号に基づいてエミュレーション条件を検出可能なエミュレーション条件検出回路と、を含んでエミュレータを構成する。このとき、上記エミュレーション条件検出回路での検出結果に基づいて特定タスクのみのエミュレーションが可能とされる。   Also, a microprocessor capable of executing a user program in which task type information is incorporated, a first register capable of holding task write destination address information set by the host system, and the user program being executed by the microprocessor The first comparison circuit that can compare the address information output from the microprocessor with the address information held in the first register, and the task type information can be held based on the comparison result of the comparison circuit A second register, a third register capable of setting a plurality of observation target task type information, a second comparison circuit capable of comparing the information held in the second register and the information held in the third register, and the second register When the holding information in the two registers matches the holding information in the third register, the task status signal is output. And the task state signal generation circuit capable formed, constituting the emulator include the emulation condition detection circuit capable of detecting emulation condition based on the task state signal. At this time, only a specific task can be emulated based on the detection result of the emulation condition detection circuit.

上記の手段によれば、第1比較回路は、上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較し、第2比較回路は、上記第2レジスタの保持情報と上記第3レジスタの保持情報とを比較する。タスク状態信号生成回路は、上記第2レジスタの保持情報と上記第3レジスタの保持情報とが一致した場合にタスク状態信号を生成し、エミュレーション条件検出回路は、上記タスク状態信号に基づいてエミュレーション条件を検出することにより、上記エミュレーション条件検出回路での検出結果に基づいて特定タスクのみのエミュレーションが可能とされ、このことが、ユーザプログラムのデバッグにおいてタスク種別を取得することにより所望のタスクについてのデバッグを可能にする。   According to the above means, the first comparison circuit obtains the address information output from the microprocessor when the user program is executed by the microprocessor and the address information held in the first register. The second comparison circuit compares the information held in the second register with the information held in the third register. The task status signal generation circuit generates a task status signal when the information held in the second register matches the information held in the third register, and the emulation condition detection circuit detects the emulation condition based on the task status signal. By detecting this, it is possible to emulate only a specific task based on the detection result of the emulation condition detection circuit. This is because debugging the desired task by acquiring the task type in the debugging of the user program. Enable.

このとき、ステップ動作、トレース情報取得、パフォーマンス測定、及びブレーク動作をそれぞれタスク種別で可能とするには、上記エミュレーション条件検出回路の検出結果に基づいてパフォーマンス測定を行うパフォーマンス測定回路と、上記エミュレーション条件検出回路の検出結果に基づいてトレース処理を行うトレース回路と、上記エミュレーション条件検出回路の検出結果に基づいてブレーク処理を行うブレーク回路とを含めると良い。   At this time, in order to enable step operation, trace information acquisition, performance measurement, and break operation for each task type, a performance measurement circuit that performs performance measurement based on the detection result of the emulation condition detection circuit, and the emulation condition A trace circuit that performs trace processing based on the detection result of the detection circuit and a break circuit that performs break processing based on the detection result of the emulation condition detection circuit may be included.

さらには、タスク種別情報が組み込まれたユーザプログラムを実行可能な中央処理装置と、外部から設定されたタスク書き込み先アドレス情報を保持可能な第4レジスタと、上記中央署理装置によって上記ユーザプログラムが実行された際に上記中央署理装置から出力されるアドレス情報とステータス情報とをデコード可能なタスクID専用デコード回路と、上記タスクID専用デコード回路のデコード出力に基づいてタスクID情報を記憶可能な第5レジスタと、上記第4レジスタの出力と上記第5レジスタの出力とを比較することにより一致するタスクID情報を得るためのID比較回路と、上記ID比較回路比較結果に応じてタスク状態信号を生成するタスク状態信号生成回路とを含んでマイクロプロセッサを構成することができる。   Furthermore, the central processing unit capable of executing a user program incorporating task type information, a fourth register capable of holding task write destination address information set from the outside, and the user program being executed by the central signing unit And a task ID dedicated decode circuit capable of decoding the address information and status information output from the central signing device and a task ID information stored on the basis of the decode output of the task ID dedicated decode circuit. A register, an ID comparison circuit for obtaining matching task ID information by comparing the output of the fourth register and the output of the fifth register, and generating a task status signal in accordance with the ID comparison circuit comparison result A microprocessor including a task state signal generation circuit.

上記の手段によれば、ID比較回路は、上記第4レジスタの出力と上記第5レジスタの出力とを比較することにより一致するタスクID情報を得る。タスク状態信号生成回路は、上記ID比較回路比較結果に応じてタスク状態信号を生成する。このタスク状態信号はマイクロプロセッサの外部出力されるため、上記マイクロプロセッサから出力されたタスク状態信号をエミュレーション条件として検出し、それに基づいて特定タスクのみのエミュレーションが可能とされる。   According to the above means, the ID comparison circuit obtains matching task ID information by comparing the output of the fourth register and the output of the fifth register. The task state signal generation circuit generates a task state signal in accordance with the ID comparison circuit comparison result. Since this task status signal is output from the microprocessor, the task status signal output from the microprocessor is detected as an emulation condition, and based on this, only a specific task can be emulated.

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記の通りである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、ユーザプログラムのデバッグにおいてタスク種別を取得することにより所望のタスクについてのデバッグが可能となる。   That is, it is possible to debug a desired task by acquiring the task type in debugging the user program.

また、ステップ動作、トレース情報取得、パフォーマンス測定、及びブレーク動作がそれぞれタスク種別で可能となり、それによって、デバッグ効率の向上を図ることができる。   In addition, step operation, trace information acquisition, performance measurement, and break operation can be performed for each task type, thereby improving debugging efficiency.

図1には、本発明にかかるエミュレータの構成例が示される。図1に示されるエミュレータ70は、特に制限されないが、エミュレータレジスタアクセス回路11、タスク検出回路12、メモリ19、及びマイクロプロセッサ20を含んで成り、ユーザプログラムのデバッグを行う場合には、パーソナルコンピュータなどのホストシステム71にコネクタなどを介して着脱自在に結合される。エミュレータ70と、上記ホストシステム71との間においては、データ、アドレス信号、及びコントロール信号など、ユーザプログラムのデバッグに必要とされる各種信号のやり取りが可能とされる。メモリ19は、上記マイクロプロセッサ20によってユーザプログラムが実行される場合のワーク領域として使用される。そしてこのワーク領域にはタスクID情報の保持領域(タスクID領域)が含まれる。タスクID情報は、ユーザプログラムにおけるタスク毎にその種別を示すものとして予めユーザプログラムに組み込まれている。   FIG. 1 shows a configuration example of an emulator according to the present invention. An emulator 70 shown in FIG. 1 includes, but is not limited to, an emulator register access circuit 11, a task detection circuit 12, a memory 19, and a microprocessor 20, and a personal computer or the like is used when debugging a user program. Is detachably coupled to the host system 71 via a connector or the like. The emulator 70 and the host system 71 can exchange various signals such as data, address signals, and control signals necessary for debugging the user program. The memory 19 is used as a work area when a user program is executed by the microprocessor 20. The work area includes a task ID information holding area (task ID area). The task ID information is incorporated in advance in the user program as indicating the type of each task in the user program.

上記タスク検出回路12は、上記マイクロプロセッサ20においてユーザプログラムが実行されるときに、ユーザプログラムにおけるタスクの検出を行う機能を有する。特に制限されないが、このタスク検出回路12は、タスクアドレスレジスタ13、2入力のアンドゲート14、アドレス比較回路15、ライト検出回路16、及びタスクIDレジスタ17とを含んで4成る。タスクアドレスレジスタ13には、上記エミュレータレジスタアクセス回路11を介して上記ホストシステム71によってタスク書き込み先アドレスが書き込まれる。アドレス比較回路15は、上記マイクロプロセッサ20から出力されるアドレス信号と上記タスクアドレスレジスタ13から出力されたアドレス信号とを比較する。この比較結果は2入力アンドゲートの一方の入力端子に伝達される。ライト検出回路16は、上記マイクロプロセッサ20でのユーザプログラムの実行状態を示すステータス信号のライト状態を検出する。この検出結果は2入力ナンドゲート14の他方の入力端子に伝達される。2入力のアンドゲート14は、上記アドレス比較回路15からのアドレス比較結果と、上記ライト検出回路16からのライト検出結果とのアンド論理を得る。このアンド論理はタスクIDレジスタ17のクロック入力端子CKに伝達される。タスクIDレジスタ17のデータ入力端子Dには、上記マイクロプロセッサ20から出力されたデータが伝達されるようになっており、上記マイクロプロセッサ20から出力されたタスクID情報(タスク種別情報)が、アンドゲート14の出力に同期してタスクIDレジスタ17に保持される。このタスクIDレジスタ17の記憶情報は、上記エミュレータレジスタアクセス回路11を介してホストシステム71によって読み出し可能とされる。   The task detection circuit 12 has a function of detecting a task in the user program when the microprocessor 20 executes the user program. Although not particularly limited, the task detection circuit 12 includes a task address register 13, a two-input AND gate 14, an address comparison circuit 15, a write detection circuit 16, and a task ID register 17. A task write destination address is written into the task address register 13 by the host system 71 via the emulator register access circuit 11. The address comparison circuit 15 compares the address signal output from the microprocessor 20 with the address signal output from the task address register 13. The comparison result is transmitted to one input terminal of the 2-input AND gate. The write detection circuit 16 detects the write state of a status signal indicating the execution state of the user program in the microprocessor 20. This detection result is transmitted to the other input terminal of the two-input NAND gate 14. The 2-input AND gate 14 obtains an AND logic between the address comparison result from the address comparison circuit 15 and the write detection result from the write detection circuit 16. This AND logic is transmitted to the clock input terminal CK of the task ID register 17. Data output from the microprocessor 20 is transmitted to the data input terminal D of the task ID register 17, and task ID information (task type information) output from the microprocessor 20 is AND. It is held in the task ID register 17 in synchronization with the output of the gate 14. Information stored in the task ID register 17 can be read out by the host system 71 via the emulator register access circuit 11.

上記の構成において、ユーザプログラムにおける所望のタスク内にのみ着目したステップ動作を行う場合、ホストシステム71からエミュレータレジスタアクセス回路11を介してタスクアドレスレジスタ13に所望のタスク書き込み先アドレスを設定する。そして、マイクロプロセッサ20において、デバッグ対象とされるユーザプログラムの実行が開始されると、アドレスバスのアドレス信号がアドレス比較回路15に伝達され、ステータス信号がライト検出回路16の伝達される。マイクロプロセッサ20から伝達されたアドレス信号と、タスクアドレスレジスタ13から出力されたアドレス信号とが一致し、且つ、上記ステータス信号がライト状態のときに、アンドゲート14の出力信号がハイレベルになる。それに同期してマイクロプロセッサ20のデータ出力(タスクID情報)がタスクIDレジスタ17に書き込まれる。このタスクIDレジスタ17の保持情報は、エミュレータレジスタアクセス回路11を介してホストシステム71に伝達され、ホストシステム71においては、伝達されたタスクID情報を用いて所定タスクのみのステップ制御が行われる。   In the above configuration, when a step operation focusing on only a desired task in the user program is performed, a desired task write destination address is set from the host system 71 to the task address register 13 via the emulator register access circuit 11. When the execution of the user program to be debugged is started in the microprocessor 20, the address signal on the address bus is transmitted to the address comparison circuit 15 and the status signal is transmitted to the write detection circuit 16. When the address signal transmitted from the microprocessor 20 matches the address signal output from the task address register 13 and the status signal is in the write state, the output signal of the AND gate 14 becomes high level. In synchronization with this, the data output (task ID information) of the microprocessor 20 is written into the task ID register 17. The information held in the task ID register 17 is transmitted to the host system 71 via the emulator register access circuit 11, and the host system 71 performs step control of only a predetermined task using the transmitted task ID information.

図2には、ホストシステム71で実行されるタスクステップ制御の一例が示される。   FIG. 2 shows an example of task step control executed by the host system 71.

このタスクステップ制御は、デバッグ情報を持つタスクから開始され(S1)、スタート時点のタスクID情報が取得される。上記デバッグ情報とはコンパイラ(アセンブラ)がユーザプログラムのデバッグのために生成する情報とされる。尚、ステップ動作は高速性が要求されるため、タスクのデバッグ時には、ユーザプログラムであるタスクのみにデバッグ情報を生成し、リアルタイムオペレーティングの部分にはデバッグ情報を生成しないようにするのが望ましい。   This task step control is started from a task having debug information (S1), and task ID information at the start time is acquired. The debug information is information generated by a compiler (assembler) for debugging a user program. Since the step operation requires high speed, it is desirable to generate debug information only for a task that is a user program and not generate debug information for a real-time operating part when debugging a task.

次に、分岐の調査が行われる(S2)。この調査では、次に実行される命令が分岐か否かの判定が行われる。この判定において、次に実行される命令が分岐であると判断された場合には、リアルタイムオペレーティングシステム又は別のタスク種別への関数への分岐の可能性があることから、タスク種別判定付きのステップ動作に遷移する(S3)。このステップ動作は、タスク種別が一致するまで繰り返し行われ、タスク種別が一致した時点で終了される(S5)。また、上記の判定において、次に実行される命令が分岐ではないと判断された場合には、通常ステップ動作へ遷移され、1ステップ動作のみ行われた後に終了される(S4,S5)。   Next, a branch is investigated (S2). In this investigation, it is determined whether or not the next instruction to be executed is a branch. In this determination, if it is determined that the instruction to be executed next is a branch, there is a possibility of branching to a function to a real-time operating system or another task type. Transition to operation (S3). This step operation is repeated until the task types match, and ends when the task types match (S5). In the above determination, if it is determined that the instruction to be executed next is not a branch, the process proceeds to the normal step operation, and after only one step operation is performed (S4, S5).

上記例によれば、以下の作用効果を得ることができる。   According to the above example, the following operational effects can be obtained.

(1)ユーザプログラムのデバッグにおいて、タスク種別を取得することにより所望のタスクについてのデバッグを行うことができる。例えば図3及び図4に示されるように、タスク1からリアルタイムオペーティングシステムに遷移した後に、上記タスク1とは異なるタスク2に遷移され、さらにそこからリアルタイムオペーティングシステムに遷移した後に、再びタスク1に遷移するようなユーザプログラムにおいて、タスク1のみのデバッグを行いたいにもかかわらず、リアルタイムオペーティングシステムやタスク2においてステップ動作が停止された場合には、タスク1について実線31で示される部分についてはデバッグが可能とされるものの、実線32で示される部分についてのデバッグを行うことができない。これに対して上記の例によれば、タスク検出回路12においてタスク検出が行われ、その検出結果に基づいて所定タスクのみのステップ制御が行われることにより、図4における実線31で示される部分のみならず、実線32で示される部分についてのデバッグが可能になる。   (1) In debugging a user program, it is possible to debug a desired task by acquiring a task type. For example, as shown in FIG. 3 and FIG. 4, after transition from task 1 to the real-time operating system, after transition to task 2 different from the above-mentioned task 1 and from there to transition to the real-time operating system, In a user program that makes a transition to task 1 again, if the step operation is stopped in the real-time operating system or task 2 even though it is desired to debug only task 1, task 1 is indicated by a solid line 31. Although the portion shown can be debugged, the portion indicated by the solid line 32 cannot be debugged. On the other hand, according to the above example, task detection is performed in the task detection circuit 12, and step control of only a predetermined task is performed based on the detection result, so that only the portion indicated by the solid line 31 in FIG. In other words, it is possible to debug the portion indicated by the solid line 32.

(2)ホストシステム71によってタスクID情報の書き込みが可能とされるタスクIDレジスタ13と、このタスクIDレジスタ13から出力されたアドレス信号とマイクロプロセッサ20から出力されるアドレス信号とを比較するアドレス比較回路15と、マイクロプロセッサ20のステータス信号からライト状態を検出するライト検出回路16と、上記アドレス比較回路15での比較結果と上記ライト検出回路16での検出結果とに基づいてタスクIDを保持するタスクIDレジスタ17とを設けることで、上記タスク検出回路12を容易に構成することができる。   (2) Task ID register 13 in which task ID information can be written by the host system 71 and an address comparison for comparing the address signal output from the task ID register 13 with the address signal output from the microprocessor 20 The task ID is held based on the circuit 15, the write detection circuit 16 that detects the write state from the status signal of the microprocessor 20, the comparison result in the address comparison circuit 15, and the detection result in the write detection circuit 16. By providing the task ID register 17, the task detection circuit 12 can be easily configured.

図5には、本発明にかかるエミュレータの別の構成例が示される。   FIG. 5 shows another configuration example of the emulator according to the present invention.

図5に示されるエミュレータ70が、図1に示されるのと大きく異なるのは、チェックIDレジスタ21、ID比較回路22、タスク状態信号生成回路23、エミュレーション条件検出回路54、パフォーマンス測定回路51、トレース回路52、及びブレーク回路53を備えている点である。   The emulator 70 shown in FIG. 5 is greatly different from that shown in FIG. 1 in that the check ID register 21, the ID comparison circuit 22, the task state signal generation circuit 23, the emulation condition detection circuit 54, the performance measurement circuit 51, the trace The circuit 52 and the break circuit 53 are provided.

チェックIDレジスタ21には、観測対象とされる複数のタスクID情報が、エミュレータレジスタアクセス回路11を介してホストシステム71によって書き込まれる。ID比較回路22は、上記チェックIDレジスタ21に記憶された複数のタスクIDと、タスクIDレジスタ17に記憶されているタスクID情報との比較を行う。この比較において一致したタスクID情報がタスク状態信号生成回路23に伝達される。このタスク状態信号生成回路23は、上記ID比較回路22から伝達されたタスクID情報に基づいてタスク状態信号24を生成する。このタスク状態信号24はエミュレーション条件検出回路54に伝達される。   A plurality of task ID information to be observed is written into the check ID register 21 by the host system 71 via the emulator register access circuit 11. The ID comparison circuit 22 compares the plurality of task IDs stored in the check ID register 21 with the task ID information stored in the task ID register 17. The task ID information that matches in this comparison is transmitted to the task state signal generation circuit 23. The task state signal generation circuit 23 generates a task state signal 24 based on the task ID information transmitted from the ID comparison circuit 22. The task status signal 24 is transmitted to the emulation condition detection circuit 54.

エミュレーション条件検出回路54は、伝達されたタスク状態信号24の値をエミュレーション条件のひとつとして検出する。パフォーマンス測定回路51は性能測定を行う。トレース回路52は、ユーザプログラムの実行状態をリアルタイムでトレースする。ブレーク回路53は、所望のブレーク条件でユーザプログラムの実行を停止する。パフォーマンス測定回路51、トレース回路52、及びブレーク回路53においては、それぞれ上記エミュレーション条件検出回路54で検出されたエミュレーション条件、すなわちタスク種別(タスクID)を条件として、パフォーマンス測定、リアルタイムトレース、及びブレーク処理が行われる。   The emulation condition detection circuit 54 detects the value of the transmitted task state signal 24 as one of the emulation conditions. The performance measurement circuit 51 performs performance measurement. The trace circuit 52 traces the execution state of the user program in real time. The break circuit 53 stops the execution of the user program under a desired break condition. In the performance measurement circuit 51, the trace circuit 52, and the break circuit 53, performance measurement, real-time trace, and break processing are performed on the basis of the emulation condition detected by the emulation condition detection circuit 54, that is, the task type (task ID). Is done.

このように図5に示される構成によれば、タスク種別(タスクID)をエミュレーション条件とすることにより、ユーザリソースを使わずに、タスク種別のステップ動作に加えて、タスク種別のパフォーマンス測定結果、タスク種別のリアルタイムトレース結果、タスク種別のブレーク結果を得ることができるため、デバッグ効率の向上を図ることができる。   In this way, according to the configuration shown in FIG. 5, by setting the task type (task ID) as an emulation condition, in addition to the task type step operation, the task type performance measurement result, Since the task type real-time trace result and the task type break result can be obtained, the debugging efficiency can be improved.

図6には、デバッグ機能を備えたマイクロプロセッサ60を含むエミュレータが示される。   FIG. 6 shows an emulator including a microprocessor 60 having a debugging function.

このマイクロプロセッサ60は、バッファ44、タスクID専用レジスタデコード回路45、タスクID専用レジスタ47、及びタスク検出回路61を含んで、公知の半導体集積回路製造技術により例えばシリコン基板などのひとつの半導体基板に形成される。タスクID専用デコード回路45は、CPU(中央処理装置)50からのアドレス信号及びステータス信号をデコードすることにより、タスクID専用レジスタ47へのタスクID情報の書き込み制御信号CONT1、及び上記タスクID専用レジスタ47からのタスクID情報の読み出し制御信号CONT2を形成する。タスクID専用レジスタ47は、CPU50から出力されたタスクID情報を上記書き込み制御信号CONT1に同期して記憶する。バッファ44は、上記タスクID専用レジスタから出力されたタスクID情報をタスクID情報の読み出し制御信号CONT2に同期してCPU50に供給する。このタスクID情報は必要に応じて、図示しないメモリのワーク領域などに保存される。タスク検出回路61は、チェックIDレジスタ41、ID比較回路42、及びタスク状態信号生成回路43を含む。チェックIDレジスタ41には、観測対象とされる複数のタスクID情報が、エミュレータレジスタアクセス回路11を介してホストシステム71によって書き込まれる。ID比較回路42は、上記チェックIDレジスタ41に記憶された複数のタスクIDと、タスクID専用レジスタ47に記憶されているタスクID情報との比較を行う。この比較において一致したタスクID情報がタスク状態信号生成回路43に伝達される。このタスク状態信号生成回路43は、上記ID比較回路42から伝達されたタスクID情報に基づいてタスク状態信号24を生成する。このタスク状態信号24はエミュレーション条件検出回路54に伝達される。   The microprocessor 60 includes a buffer 44, a task ID dedicated register decode circuit 45, a task ID dedicated register 47, and a task detection circuit 61. The microprocessor 60 is formed on a single semiconductor substrate such as a silicon substrate by a known semiconductor integrated circuit manufacturing technique. It is formed. The task ID dedicated decode circuit 45 decodes the address signal and status signal from the CPU (central processing unit) 50, thereby writing a task ID information write control signal CONT1 to the task ID dedicated register 47 and the task ID dedicated register. The task ID information read control signal CONT2 from 47 is formed. The task ID dedicated register 47 stores task ID information output from the CPU 50 in synchronization with the write control signal CONT1. The buffer 44 supplies the task ID information output from the task ID dedicated register to the CPU 50 in synchronization with the task ID information read control signal CONT2. The task ID information is saved in a work area of a memory (not shown) as necessary. The task detection circuit 61 includes a check ID register 41, an ID comparison circuit 42, and a task state signal generation circuit 43. In the check ID register 41, a plurality of task ID information to be observed is written by the host system 71 via the emulator register access circuit 11. The ID comparison circuit 42 compares the plurality of task IDs stored in the check ID register 41 with the task ID information stored in the task ID dedicated register 47. The task ID information that matches in this comparison is transmitted to the task state signal generation circuit 43. The task status signal generation circuit 43 generates a task status signal 24 based on the task ID information transmitted from the ID comparison circuit 42. The task status signal 24 is transmitted to the emulation condition detection circuit 54.

このようにデバッグ機能を備えたマイクロプロセッサ60を用いても、エミュレーション条件検出回路54において、伝達されたタスク状態信号24の値をエミュレーション条件のひとつとして検出することができる。また、デバッグ機能を備えたマイクロプロセッサ60を用いる場合には、バッファ44、タスクID専用レジスタデコード回路45、タスクID専用レジスタ47、及びタスク検出回路61がチップに内蔵されるため、マイクロプロセッサ60の周辺回路の簡素化を図ることができる。尚、図6に示されるエミュレータ70においても、図5に示されるのと同様に、パフォーマンス測定回路51、トレース回路52、及びブレーク回路53を設けることができる。   Even when the microprocessor 60 having the debugging function is used as described above, the emulation condition detection circuit 54 can detect the value of the transmitted task status signal 24 as one of the emulation conditions. When the microprocessor 60 having a debugging function is used, the buffer 44, the task ID dedicated register decode circuit 45, the task ID dedicated register 47, and the task detection circuit 61 are built in the chip. The peripheral circuit can be simplified. In the emulator 70 shown in FIG. 6, the performance measurement circuit 51, the trace circuit 52, and the break circuit 53 can be provided in the same manner as shown in FIG.

以上本発明者によってなされた発明を具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   Although the invention made by the present inventor has been specifically described above, the present invention is not limited thereto, and it goes without saying that various changes can be made without departing from the scope of the invention.

例えば、図1及び図5に示されるタスク検出回路12をマイクロプロセッサ20に内蔵することにより、当該マイクロプロセッサ20にデバッグ機能を持たせるようにしても良い。   For example, the task detection circuit 12 shown in FIGS. 1 and 5 may be built in the microprocessor 20 so that the microprocessor 20 has a debugging function.

以上の説明では主として本発明者によってなされた発明をその背景となった利用分野であるエミュレータに適用した場合について説明したが、本発明はそれに限定されるものではなく、マイクロプロセッサ単体、若しくはそれを含むシステムに広く適用することができる。   In the above description, the case where the invention made mainly by the present inventor is applied to the emulator which is the field of use behind the invention has been described. However, the present invention is not limited thereto, and the microprocessor alone or the Can be widely applied to including systems.

本発明は、ユーザプログラムの実行を条件に適用することができる。   The present invention can be applied on condition that the user program is executed.

本発明にかかるエミュレータの構成例ブロック図である。1 is a block diagram illustrating a configuration example of an emulator according to the present invention. 上記エミュレータに結合されたホストシステムで実行されるタスクステップ制御の説明図である。It is explanatory drawing of the task step control performed with the host system couple | bonded with the said emulator. ユーザプログラムにおけるタスク遷移の説明図である。It is explanatory drawing of the task transition in a user program. ユーザプログラムにおけるタスク遷移の別の説明図である。It is another explanatory drawing of the task transition in a user program. 本発明にかかるエミュレータの別の構成例ブロック図である。FIG. 10 is a block diagram illustrating another configuration example of an emulator according to the present invention. 本発明にかかるエミュレータの別の構成例ブロック図である。FIG. 10 is a block diagram illustrating another configuration example of an emulator according to the present invention.

符号の説明Explanation of symbols

11 エミュレータレジスタアクセス回路
12,61 タスク検出回路
13 タスクアドレスレジスタ
14 アンドゲート
15 アドレス比較回路
16 ライト検出回路
17 タスクIDレジスタ
19 メモリ
20,60 マイクロプロセッサ
41 チェックIDレジスタ
42 ID比較回路
43 タスク状態信号生成回路
44 バッファ
45 タスクID専用デコード回路
47 タスクID専用レジスタ
50 CPU
51 パフォーマンス回路
52 トレース回路
53 ブレーク回路
54 エミュレーション条件検出回路
61 タスク検出回路
70 エミュレータ
71 ホストシステム
11 Emulator register access circuit 12, 61 Task detection circuit 13 Task address register 14 AND gate 15 Address comparison circuit 16 Write detection circuit 17 Task ID register 19 Memory 20, 60 Microprocessor 41 Check ID register 42 ID comparison circuit 43 Task status signal generation Circuit 44 Buffer 45 Task ID dedicated decode circuit 47 Task ID dedicated register 50 CPU
51 Performance Circuit 52 Trace Circuit 53 Break Circuit 54 Emulation Condition Detection Circuit 61 Task Detection Circuit 70 Emulator 71 Host System

Claims (5)

タスク種別情報が組み込まれたユーザプログラムを実行可能なマイクロプロセッサと、
ホストシステムによって設定されたタスク書き込み先アドレス情報を保持可能な第1レジスタと、
上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較可能な比較回路と、
上記比較回路の比較結果に基づいてタスク種別情報を保持可能な第2レジスタと、を含み、上記第2レジスタは上記ホストシステムによって読み出し可能にされたエミュレータ。
A microprocessor capable of executing a user program in which task type information is embedded;
A first register capable of holding task write destination address information set by the host system;
A comparison circuit capable of comparing the address information output from the microprocessor when the user program is executed by the microprocessor and the address information held in the first register;
A second register capable of holding task type information based on a comparison result of the comparison circuit, wherein the second register is readable by the host system.
タスク種別情報が組み込まれたユーザプログラムを実行可能なマイクロプロセッサと、
ホストシステムによって設定されたタスク書き込み先アドレス情報を保持可能な第1レジスタと、
上記マイクロプロセッサによって上記ユーザプログラムが実行された際に上記マイクロプロセッサから出力されるアドレス情報と、上記第1レジスタに保持されているアドレス情報とを比較可能な第1比較回路と、
上記比較回路の比較結果に基づいてタスク種別情報を保持可能な第2レジスタと、
複数の観測対象タスク種別情報を設定可能な第3レジスタと、
上記第2レジスタの保持情報と上記第3レジスタの保持情報とを比較可能な第2比較回路と、
上記第2レジスタの保持情報と上記第3レジスタの保持情報とが一致した場合にタスク状態信号を生成可能なタスク状態信号生成回路と、
上記タスク状態信号に基づいてエミュレーション条件を検出可能なエミュレーション条件検出回路と、を含み、上記エミュレーション条件検出回路での検出結果に基づいて特定タスクのみのエミュレーションが可能とされたエミュレータ。
A microprocessor capable of executing a user program in which task type information is embedded;
A first register capable of holding task write destination address information set by the host system;
A first comparison circuit capable of comparing the address information output from the microprocessor when the user program is executed by the microprocessor and the address information held in the first register;
A second register capable of holding task type information based on the comparison result of the comparison circuit;
A third register capable of setting a plurality of observation target task type information;
A second comparison circuit capable of comparing the information held in the second register and the information held in the third register;
A task state signal generation circuit capable of generating a task state signal when the holding information of the second register matches the holding information of the third register;
And an emulation condition detection circuit capable of detecting an emulation condition based on the task status signal, and an emulator capable of emulating only a specific task based on a detection result of the emulation condition detection circuit.
上記エミュレーション条件検出回路の検出結果に基づいてパフォーマンス測定を行うパフォーマンス測定回路と、
上記エミュレーション条件検出回路の検出結果に基づいてトレース処理を行うトレース回路と、
上記エミュレーション条件検出回路の検出結果に基づいてブレーク処理を行うブレーク回路と、を含む請求項2記載のエミュレータ。
A performance measurement circuit for measuring performance based on the detection result of the emulation condition detection circuit;
A trace circuit that performs trace processing based on the detection result of the emulation condition detection circuit;
The emulator according to claim 2, further comprising: a break circuit that performs break processing based on a detection result of the emulation condition detection circuit.
タスク種別情報が組み込まれたユーザプログラムを実行可能な中央処理装置と、
外部から設定されたタスク書き込み先アドレス情報を保持可能な第4レジスタと、
上記中央署理装置によって上記ユーザプログラムが実行された際に上記中央署理装置から出力されるアドレス情報とステータス情報とをデコード可能なタスクID専用デコード回路と、
上記タスクID専用デコード回路のデコード出力に基づいてタスクID情報を記憶可能な第5レジスタと、
上記第4レジスタの出力と上記第5レジスタの出力とを比較することにより一致するタスクID情報を得るためのID比較回路と、
上記ID比較回路比較結果に応じてタスク状態信号を生成するタスク状態信号生成回路と、を含み、上記タスク状態信号が外部出力可能にされて成るマイクロプロセッサ。
A central processing unit capable of executing a user program in which task type information is embedded;
A fourth register capable of holding task write destination address information set externally;
A task ID dedicated decoding circuit capable of decoding address information and status information output from the central signing device when the user program is executed by the central signing device;
A fifth register capable of storing task ID information based on the decode output of the task ID dedicated decode circuit;
An ID comparison circuit for obtaining matching task ID information by comparing the output of the fourth register and the output of the fifth register;
And a task state signal generation circuit for generating a task state signal in accordance with the ID comparison circuit comparison result, wherein the task state signal can be externally output.
請求項4記載のマイクロプロセッサと、
上記マイクロプロセッサから出力されたタスク状態信号をエミュレーション条件として検出可能なエミュレーション条件検出回路と、を含んで成るエミュレータ。
A microprocessor according to claim 4;
An emulator comprising: an emulation condition detection circuit capable of detecting a task status signal output from the microprocessor as an emulation condition.
JP2004060003A 2004-03-04 2004-03-04 Emulator and microprocessor Pending JP2005250821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004060003A JP2005250821A (en) 2004-03-04 2004-03-04 Emulator and microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004060003A JP2005250821A (en) 2004-03-04 2004-03-04 Emulator and microprocessor

Publications (1)

Publication Number Publication Date
JP2005250821A true JP2005250821A (en) 2005-09-15

Family

ID=35031249

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004060003A Pending JP2005250821A (en) 2004-03-04 2004-03-04 Emulator and microprocessor

Country Status (1)

Country Link
JP (1) JP2005250821A (en)

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5971555A (en) * 1982-10-18 1984-04-23 Hitachi Ltd Performance monitoring system
JPS63236142A (en) * 1987-03-24 1988-10-03 Yokogawa Electric Corp Software monitoring device
JPS6442745A (en) * 1987-08-11 1989-02-15 Nec Corp Trapping system
JPH01113841A (en) * 1987-10-28 1989-05-02 Hitachi Ltd Multi-task debugging mechanism
JPH01145740A (en) * 1987-12-02 1989-06-07 Hitachi Ltd Emulator for multi-process
JPH03113648A (en) * 1989-09-28 1991-05-15 Mitsubishi Electric Corp Program debug system
JPH05165672A (en) * 1991-12-19 1993-07-02 Mitsubishi Electric Corp Processor
JPH0612504A (en) * 1992-01-27 1994-01-21 Nec Corp Emulation chip
JPH09259002A (en) * 1996-03-22 1997-10-03 Hitachi Ltd Debug support device
JPH10177505A (en) * 1996-12-16 1998-06-30 Mitsubishi Electric Corp Emulator device
JPH10187480A (en) * 1996-12-26 1998-07-21 Hitachi Ltd Emulator
JPH10254738A (en) * 1997-03-12 1998-09-25 Mitsubishi Electric Corp Emulator device and emulation method
JPH11102306A (en) * 1997-09-29 1999-04-13 Hitachi Ltd Emulator
JP2001134463A (en) * 1999-11-04 2001-05-18 Fujitsu Ltd Method for monitoring software running history
JP2001350648A (en) * 2000-06-08 2001-12-21 Hitachi Ltd Microcomputer

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5971555A (en) * 1982-10-18 1984-04-23 Hitachi Ltd Performance monitoring system
JPS63236142A (en) * 1987-03-24 1988-10-03 Yokogawa Electric Corp Software monitoring device
JPS6442745A (en) * 1987-08-11 1989-02-15 Nec Corp Trapping system
JPH01113841A (en) * 1987-10-28 1989-05-02 Hitachi Ltd Multi-task debugging mechanism
JPH01145740A (en) * 1987-12-02 1989-06-07 Hitachi Ltd Emulator for multi-process
JPH03113648A (en) * 1989-09-28 1991-05-15 Mitsubishi Electric Corp Program debug system
JPH05165672A (en) * 1991-12-19 1993-07-02 Mitsubishi Electric Corp Processor
JPH0612504A (en) * 1992-01-27 1994-01-21 Nec Corp Emulation chip
JPH09259002A (en) * 1996-03-22 1997-10-03 Hitachi Ltd Debug support device
JPH10177505A (en) * 1996-12-16 1998-06-30 Mitsubishi Electric Corp Emulator device
JPH10187480A (en) * 1996-12-26 1998-07-21 Hitachi Ltd Emulator
JPH10254738A (en) * 1997-03-12 1998-09-25 Mitsubishi Electric Corp Emulator device and emulation method
JPH11102306A (en) * 1997-09-29 1999-04-13 Hitachi Ltd Emulator
JP2001134463A (en) * 1999-11-04 2001-05-18 Fujitsu Ltd Method for monitoring software running history
JP2001350648A (en) * 2000-06-08 2001-12-21 Hitachi Ltd Microcomputer

Similar Documents

Publication Publication Date Title
US7689867B2 (en) Multiprocessor breakpoint
US7398419B2 (en) Method and apparatus for seeding differences in lock-stepped processors
US11593241B2 (en) Processor with debug pipeline
JPH113245A (en) Smart debugging interface circuit
US11513804B2 (en) Pipeline flattener with conditional triggers
EP0902367B1 (en) Data processing unit with debug capabilities
JP2006507586A (en) Apparatus and method for analyzing embedded system
US7428661B2 (en) Test and debug processor and method
US6968410B2 (en) Multi-threaded processing of system management interrupts
JP2001051874A (en) Microcomputer
KR100825786B1 (en) Memory card and debugging method for the same
JP2019204388A (en) Semiconductor device and debug method
JP2005250821A (en) Emulator and microprocessor
JP4600134B2 (en) Multiprocessor system
JP2006146412A (en) Multi-core processor and debugging method
JP5467172B1 (en) Information processing system and information processing method
JP3068578B2 (en) In-circuit emulator and saturation calculation processing method
JP2006318172A (en) Microcomputer
KR100658485B1 (en) Microprocessor development system
JP2005070951A (en) Program processing apparatus
JP2005267349A (en) Processing module and control method thereof
JPH0750446B2 (en) Data processing device
JP2009223606A (en) Debugging device and debugging method
JP2005292899A (en) Microprocessor
JP2004206425A (en) Tracing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070223

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090410

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090428

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090901