JPH1115704A - Emulation control method and emulator - Google Patents

Emulation control method and emulator

Info

Publication number
JPH1115704A
JPH1115704A JP9163101A JP16310197A JPH1115704A JP H1115704 A JPH1115704 A JP H1115704A JP 9163101 A JP9163101 A JP 9163101A JP 16310197 A JP16310197 A JP 16310197A JP H1115704 A JPH1115704 A JP H1115704A
Authority
JP
Japan
Prior art keywords
task
state
time
moment
monitored
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
JP9163101A
Other languages
Japanese (ja)
Inventor
Hideo Miyauchi
英男 宮内
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 Design Corp
Mitsubishi Electric Corp
Original Assignee
Renesas Design Corp
Mitsubishi Electric 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 Design Corp, Mitsubishi Electric Corp filed Critical Renesas Design Corp
Priority to JP9163101A priority Critical patent/JPH1115704A/en
Publication of JPH1115704A publication Critical patent/JPH1115704A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To obtain an emulation control method and an emulator by which the time that takes from the moment when a task that is an object transits to a ready state to the moment when it transits to a run state at the time of debugging a program that is carried out under an, is directly obtained, OS and the time measurement result to a user such as a programmer, is presented. SOLUTION: A time measurement stop watch 8 which starts time measurement when a task that is searched for by a task control block supervisory circuit 3 which searches for a task that transits to a ready state is a task of a previously determined supervisory object, stops time measurement when a run state task supervisory circuit 4 detects that the task of a supervisory object is in a run state and measures time which takes from the moment when the task of the supervisory object becomes a ready state to the moment when it becomes a run state is provided.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、OSのもとで実
行されるプログラムのデバッグに用いるエミュレーショ
ン制御方法およびこの制御方法を用いたエミュレータ装
置に関するものである。
[0001] 1. Field of the Invention [0002] The present invention relates to an emulation control method used for debugging a program executed under an OS and an emulator apparatus using the control method.

【0002】[0002]

【従来の技術】図5は従来のエミュレーション制御方法
を用いたエミュレータ装置の一例の構成を示すブロック
図であり、図において、31はエミュレーションのター
ゲットであるターゲットCPU、32はデバッグ対象の
プログラムおよびOSを格納するためのターゲットメモ
リ、39はデバッグ中のターゲットメモリ32の内容を
記録するためのトレースメモリ、40はターゲットメモ
リ32にデバッグ対象のプログラムを格納したりする
等、エミュレーションを制御するホスト計算機、41は
エミュレータ装置、42はエミュレータ装置41の各ユ
ニットを制御するためのエミュレータコントロールCP
U、43はホスト計算機40とエミュレータ装置41と
の間の通信のためにホスト計算機40をエミュレータ装
置41に接続するホスト通信回路、44はターゲットC
PU用バス、45はエミュレータコントロールCPU用
バスである。
2. Description of the Related Art FIG. 5 is a block diagram showing an example of the configuration of an emulator device using a conventional emulation control method. In FIG. 5, reference numeral 31 denotes a target CPU which is an emulation target, and 32 denotes a program to be debugged and an OS. , A trace memory 39 for recording the contents of the target memory 32 being debugged, a host computer 40 for controlling emulation such as storing a program to be debugged in the target memory 32, 41 is an emulator device, 42 is an emulator control CP for controlling each unit of the emulator device 41
U and 43 are host communication circuits connecting the host computer 40 to the emulator device 41 for communication between the host computer 40 and the emulator device 41, and 44 is a target C
A PU bus 45 is an emulator control CPU bus.

【0003】次に動作について説明する。図5に示した
ような従来のエミュレータ装置は、OSの管理下で実行
されるプログラムをデバッグする際に監視対象のタスク
がREADY状態に遷移する瞬間からRUN状態に遷移
するまでに経過する時間を計測する直接的な手段を有し
ておらず、それに代わり、デバッグ中のターゲットメモ
リ32の内容を記録するトレースメモリ39を用いて、
監視対象のタスクがREADY状態に遷移する瞬間から
RUN状態に遷移する瞬間までに経過する時間を間接的
に求めている。
Next, the operation will be described. The conventional emulator device as shown in FIG. 5 is designed to measure the time that elapses from the moment when the monitored task transitions to the READY state to the time when the task changes to the RUN state when debugging a program executed under the control of the OS. It does not have a direct means to measure, but instead uses a trace memory 39 to record the contents of the target memory 32 during debugging,
The time that elapses from the moment when the monitored task transitions to the READY state to the moment when the task changes to the RUN state is indirectly obtained.

【0004】まず、エミュレータ装置41において、タ
ーゲットメモリ32からトレースメモリ39にその内容
を書き込む時間間隔(以下、サンプリング時間と記す)
が決定される。次に、OSが管理するタスクコントロー
ルブロックおよびRUN状態のタスク番号が書き込まれ
ているターゲットメモリ32の内容をトレースメモリ3
9に書き込むように設定する。その後、ホスト計算機4
0は、ターゲットメモリ32にデバッグ対象のプログラ
ムを転送し、ターゲットCPU31によるそのデバッグ
対象のプログラムの実行を起動してデバッグを開始す
る。そして、監視対象となっているタスクが処理された
だろうと思われる時間が経過した後、ホスト計算機40
はホスト通信回路43を介してトレースメモリ39の内
容を読み取る。読み取ったトレースメモリ39の内容に
は全てのタスクの遷移に関する情報が含まれているの
で、ホスト計算機40は、その内容から監視対象となっ
ているタスクが任意の状態からREADY状態に遷移し
た箇所と監視対象となっているタスクがREADY状態
からRUN状態に遷移した箇所とを特定し、これら2つ
の箇所の間に挟まれるサンプリング数とサンプリング時
間とからそれら2つの箇所の間に経過した時間を求め
る。
First, in the emulator device 41, a time interval for writing the contents from the target memory 32 to the trace memory 39 (hereinafter referred to as a sampling time).
Is determined. Next, the contents of the target memory 32 in which the task control block managed by the OS and the task number in the RUN state are written are stored in the trace memory 3.
9 to be written. Then, the host computer 4
0 transfers the program to be debugged to the target memory 32, starts the execution of the program to be debugged by the target CPU 31, and starts debugging. Then, after a lapse of time that the task to be monitored is considered to have been processed, the host computer 40
Reads the contents of the trace memory 39 via the host communication circuit 43. Since the read contents of the trace memory 39 include information on transitions of all tasks, the host computer 40 determines from the contents that the task to be monitored has transitioned from any state to the READY state. The point where the task to be monitored has transitioned from the READY state to the RUN state is specified, and the time elapsed between the two points is obtained from the sampling number and the sampling time interposed between the two points. .

【0005】しかしながら、この方法ではターゲットメ
モリ32からトレースメモリ39に書き込むデータが多
いため、トレースメモリ39があふれてしまう場合があ
る。また、トレースメモリ39には全てのタスクの情報
がターゲットメモリ32から書き込まれているので、そ
の中から監視対象となっているタスクに関する情報だけ
を特定するには手間がかかってしまう。さらに、監視対
象となっているタスクが任意の状態からREADY状態
に遷移した箇所と監視対象となっているタスクがREA
DY状態からRUN状態に遷移した箇所との間に挟まれ
るサンプリング数を数えることはさらに多くの時間を要
し、また、間違えやすいので、タスクがREADY状態
に遷移する瞬間からRUN状態に遷移するまでに経過す
る時間を間接的に計測するこの方法はほとんど使われる
ことがない。
However, in this method, since there is much data to be written from the target memory 32 to the trace memory 39, the trace memory 39 may overflow. Further, since the information of all the tasks is written from the target memory 32 to the trace memory 39, it takes time and effort to specify only the information on the task to be monitored from the information. Furthermore, the location where the task to be monitored has transitioned from any state to the READY state and the task being monitored
Counting the number of samples interposed between the DY state and the transition to the RUN state requires more time and it is easy to make a mistake, so from the moment the task transitions to the READY state to the transition to the RUN state. This method of indirectly measuring the time that elapses is rarely used.

【0006】[0006]

【発明が解決しようとする課題】従来のエミュレーショ
ン制御方法およびエミュレータ装置は以上のように構成
されているので、OSのもとで実行されるプログラムを
デバッグする際に対象とするタスクがREADY状態に
遷移する瞬間からRUN状態に遷移する瞬間までに経過
する時間をトレースメモリ39に転送された全てのタス
クの情報から間接的に求めるしかなく、その情報から監
視対象となっているタスクの情報だけを特定するには多
くの手間を要し、効率的にデバッグを行えないという課
題があった。
Since the conventional emulation control method and the conventional emulation device are configured as described above, the task to be debugged when the program executed under the OS is debugged is in the READY state. The time that elapses from the moment of transition to the moment of transition to the RUN state must be indirectly obtained from the information of all the tasks transferred to the trace memory 39, and only the information of the task to be monitored is obtained from the information. There is a problem that it takes a lot of trouble to specify, and debugging cannot be performed efficiently.

【0007】この発明は上記のような課題を解決するた
めになされたもので、OSのもとで実行されるプログラ
ムをデバッグする際に対象とするタスクがREADY状
態に遷移する瞬間からRUN状態に遷移する瞬間までに
経過する時間を直接的に求め、プログラマ等のユーザに
その時間計測結果を提示することができるエミュレーシ
ョン制御方法およびエミュレータ装置を得ることを目的
とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem. When debugging a program to be executed under an OS, a target task transitions from a ready state to a run state. It is an object of the present invention to obtain an emulation control method and an emulator device that can directly determine a time that elapses until a transition moment and present the time measurement result to a user such as a programmer.

【0008】[0008]

【課題を解決するための手段】請求項1記載の発明に係
るエミュレーション制御方法は、タスク情報を監視する
ことによりREADY状態に遷移したタスクを探し出
し、探し出したタスクが予め定めた監視対象のタスクで
あるならば時間計測を開始し、監視対象のタスクがRU
N状態になったことを検出すると時間計測を停止して、
監視対象のタスクがREADY状態になった瞬間からR
UN状態になる瞬間までに経過した時間を計測するもの
である。
According to the first aspect of the present invention, there is provided an emulation control method in which a task which has transitioned to a READY state is searched for by monitoring task information, and the found task is a predetermined monitoring target task. If there is, start time measurement, and if the task to be monitored is RU
When detecting that the state has become N, the time measurement is stopped,
R from the moment the monitored task enters the READY state
It measures the time that has passed until the moment when it enters the UN state.

【0009】請求項2記載の発明に係るエミュレーショ
ン制御方法は、上記のようにして経過した時間を計測し
た後、計測した経過時間を一旦エミュレータ装置内に記
録するものである。
The emulation control method according to the second aspect of the present invention measures the elapsed time as described above, and then temporarily records the measured elapsed time in the emulator device.

【0010】請求項3記載の発明に係るエミュレータ装
置は、タスクコントロールブロック監視手段が探し出し
たタスクが予め定めた監視対象のタスクであるならば時
間計測を開始し、RUN状態タスク監視手段が監視対象
のタスクがRUN状態であることを検出すると時間計測
を停止して、監視対象のタスクがREADY状態になっ
た瞬間からRUN状態になる瞬間までに経過した時間を
計測する時間計測手段とを備えたものである。
The emulator device according to the third aspect of the present invention starts time measurement if the task found by the task control block monitoring means is a predetermined monitoring target task, and the RUN status task monitoring means sets the monitoring target Time measurement means for stopping the time measurement when detecting that the task is in the RUN state, and measuring the time elapsed from the moment the monitored task enters the RUN state to the moment it enters the RUN state. Things.

【0011】請求項4記載の発明に係るエミュレータ装
置は、時間計測手段により計測された経過時間を記録す
るトレースメモリを備えたものである。
According to a fourth aspect of the present invention, there is provided an emulator device having a trace memory for recording the elapsed time measured by the time measuring means.

【0012】請求項5記載の発明に係るエミュレータ装
置は、時間計測手段がタスクコントロールブロック監視
手段の出力するタスク番号が監視対象タスク番号レジス
タに保持されたタスク番号に一致する場合に時間計測を
開始し、タスク番号監視手段の出力するタスク番号が監
視対象タスク番号レジスタに保持されたタスク番号に一
致する場合に時間計測を停止するものである。
According to a fifth aspect of the present invention, in the emulator apparatus, the time measurement means starts time measurement when the task number output from the task control block monitoring means matches the task number held in the monitored task number register. When the task number output from the task number monitoring means matches the task number stored in the monitoring target task number register, the time measurement is stopped.

【0013】請求項6記載の発明に係るエミュレータ装
置は、時間計測手段が、タスクコントロールブロック監
視手段が出力するタスク番号と監視対象のタスクのタス
ク番号とが一致する場合にスタート信号を出力する第1
のコンパレータと、RUN状態タスク監視手段が出力す
るタスク番号と監視対象のタスクのタスク番号とが一致
する場合にストップ信号を出力する第2のコンパレータ
と、スタート信号に応答して時間計測を開始しストップ
信号に応答して前記時間計測を停止する時間計測ストッ
プウォッチとを備えたものである。
According to a sixth aspect of the present invention, in the emulator apparatus, the time measuring means outputs a start signal when the task number output by the task control block monitoring means matches the task number of the task to be monitored. 1
And a second comparator that outputs a stop signal when the task number output by the RUN status task monitoring means matches the task number of the task to be monitored, and starts time measurement in response to the start signal. A time measurement stopwatch that stops the time measurement in response to a stop signal.

【0014】[0014]

【発明の実施の形態】以下、この発明の実施の一形態を
説明する。 実施の形態1.図1はこの発明の実施の形態1によるエ
ミュレーション制御方法を実現するエミュレータ装置の
構成を示すブロック図であり、図において、1はエミュ
レーションのターゲットであるターゲットCPU、2は
デバッグ対象のプログラムおよびOSを格納するととも
に、ターゲットCPU1で実行されるタスクに関する情
報、すなわちタスクコントロールブロック等のタスク情
報を格納するためのターゲットメモリ、3はターゲット
メモリ2内に格納されたタスクコントロールブロックを
監視することによりREADY状態に遷移したタスクを
探し出しそのタスク番号を出力するタスクコントロール
ブロック監視回路(タスクコントロールブロック監視手
段)、4はRUN状態にあるタスクを監視しRUN状態
にあるタスクのタスク番号を出力するRUN状態タスク
監視回路(RUN状態タスク監視手段)、5および6は
コンパレータ、7は監視対象のタスクのタスク番号を保
持する監視対象タスク番号レジスタ、8は監視対象のタ
スクがREADY状態に遷移する瞬間からRUN状態に
遷移する瞬間までに経過した時間を計測する時間計測ス
トップウォッチ、9は時間計測ストップウォッチ8によ
る時間計測結果を記録するトレースメモリ、10はター
ゲットメモリ2にデバッグ対象のプログラムを格納した
り、監視対象のタスクのタスク番号を監視対象タスク番
号レジスタ7に書き込んだりする等、エミュレーション
を制御するホスト計算機、11はエミュレータ装置、1
2はエミュレータ装置11の各ユニットを制御するため
のエミュレータコントロールCPU、13はホスト計算
機10とエミュレータ装置11との間の通信のためにホ
スト計算機10をエミュレータ装置11に接続するホス
ト通信回路、14はターゲットCPU用バス、15はエ
ミュレータコントロールCPU用バスである。なお、時
間計測手段は、2つのコンパレータ5および6と、時間
計測ストップウォッチ8とから構成される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below. Embodiment 1 FIG. FIG. 1 is a block diagram showing a configuration of an emulator apparatus for realizing an emulation control method according to Embodiment 1 of the present invention. In the figure, reference numeral 1 denotes a target CPU as an emulation target, and 2 denotes a program to be debugged and an OS. The target memory 3 for storing information on tasks executed by the target CPU 1, that is, task information such as task control blocks, monitors the task control blocks stored in the target memory 2. A task control block monitoring circuit (task control block monitoring means) for searching for a task that has transitioned to a task state and outputting the task number, monitors the task in the RUN state and outputs the task number of the task in the RUN state. RUN status task monitoring circuit (RUN status task monitoring means), 5 and 6 are comparators, 7 is a monitoring target task number register holding the task number of the monitoring target task, and 8 is a transition of the monitoring target task to the READY state. A time measurement stopwatch for measuring the time elapsed from the moment to the transition to the RUN state, 9 is a trace memory for recording the time measurement result by the time measurement stopwatch 8, and 10 is a debug target program stored in the target memory 2. And a host computer for controlling emulation, such as writing the task number of the monitored task to the monitored task number register 7.
2 is an emulator control CPU for controlling each unit of the emulator apparatus 11, 13 is a host communication circuit for connecting the host computer 10 to the emulator apparatus 11 for communication between the host computer 10 and the emulator apparatus 11, and 14 is A target CPU bus 15 is an emulator control CPU bus. The time measuring means includes two comparators 5 and 6, and a time measuring stopwatch 8.

【0015】また、図2はOSによって管理されるタス
クレディキューの状態を示す説明図であり、図3はター
ゲットメモリ2内のタスク情報を示す説明図である。図
3において、21はOSによって書き込まれている現在
のRUN状態タスク番号、22はOSによってターゲッ
トメモリ2内に書き込まれているタスクコントロールブ
ロック(タスク番号およびタスク状態)である。実際に
は、タスク番号は2進数であるが、ここでは、説明を簡
略化するために、図2に示すタスクTA,TB,TCお
よびTD、後で述べる中断中のタスクTEのタスク番号
はそれぞれ“1”,“2”,“3”,“4”,“5”で
あると仮定する。
FIG. 2 is an explanatory diagram showing a state of a task ready queue managed by the OS, and FIG. 3 is an explanatory diagram showing task information in the target memory 2. In FIG. 3, reference numeral 21 denotes a current RUN state task number written by the OS, and reference numeral 22 denotes a task control block (task number and task state) written in the target memory 2 by the OS. Actually, the task number is a binary number. Here, for the sake of simplicity, the task numbers of the tasks TA, TB, TC, and TD shown in FIG. It is assumed that they are "1", "2", "3", "4", and "5".

【0016】次に動作について説明する。エミュレーシ
ョン実行前に、デバッグ対象のプログラムはOSと共に
ターゲットメモリ2に格納される。そして、エミュレー
ション実行が開始されると、デバッグ対象であるプログ
ラムがOSのもとでターゲットCPU1において実行さ
れ、順次タスクが処理される。
Next, the operation will be described. Before emulation execution, the program to be debugged is stored in the target memory 2 together with the OS. Then, when the emulation execution is started, the program to be debugged is executed in the target CPU 1 under the OS, and the tasks are sequentially processed.

【0017】その後、ある時点でプログラムの実行が中
断させられていると仮定する。また、その時、タスクレ
ディキューには、図2に示すように、OSによってタス
クTA,TB,TCおよびTDが繋がれた状態で実行待
ちしているとする。この際、OSによってターゲットメ
モリ2内のRUN状態タスク番号21にはタスクレディ
キュー先頭のタスクTAのタスク番号“1”が書き込ま
れている。さらに、OSによってタスクコントロールブ
ロック22には実行が中断されたタスクTE、ならび
に、タスクレディキューに繋がれた状態で実行待ちをし
ているタスクTA,TB,TCおよびTDの状態が書き
込まれている。ここで、タスク番号“1”のタスクTA
の状態はRUN状態、タスク番号“2”のタスクTBの
状態はREADY状態、タスク番号“3”のタスクTC
の状態はREADY状態、タスク番号“4”のタスクT
Dの状態はREADY状態、実行が中断しているタスク
番号“5”のタスクTEの状態はWAIT状態である。
Thereafter, it is assumed that the execution of the program is interrupted at some point. Also, at this time, it is assumed that the task TA, TB, TC, and TD are waiting for execution in the task ready queue in a state where the tasks TA, TB, TC, and TD are connected by the OS, as shown in FIG. At this time, the task number “1” of the task TA at the head of the task ready queue is written in the RUN status task number 21 in the target memory 2 by the OS. Further, the task TE whose execution has been interrupted and the states of tasks TA, TB, TC and TD waiting to be executed while being connected to the task ready queue are written in the task control block 22 by the OS. . Here, task TA of task number “1”
Is the RUN state, the state of the task TB with the task number “2” is the READY state, and the task TC with the task number “3”.
State is READY state, task T of task number "4"
The state of D is the READY state, and the state of the task TE of the task number “5” whose execution is suspended is the WAIT state.

【0018】図4はこの実施の形態1によるエミュレー
タ装置における所定のタスクがREADY状態からRU
N状態に遷移するまでに要する時間(待ち時間)をリア
ルタイムで計測する動作の流れを示すフローチャートで
ある。上記したような実行が中断している状況下におい
て、まず、ステップST1において、ホスト計算機10
がホスト通信回路13を介して監視対象タスク番号レジ
スタ7へ監視対象となるタスクのタスク番号を書き込
む。この実施の形態1ではタスクTEのタスク番号
“5”を書き込むものとする。なお、このタスク番号
は、予めプログラマ等のユーザがホスト計算機1に接続
された入力装置等を介してホスト計算機1に入力したも
のである。そして、エミュレータ装置はターゲットCP
U1の実行を再開する。
FIG. 4 shows that a predetermined task in the emulator device according to the first embodiment is changed from the READY state to the RU state.
It is a flowchart which shows the flow of operation | movement which measures the time (waiting time) required until it changes to N state in real time. In a situation where the execution is suspended as described above, first, in step ST1, the host computer 10
Writes the task number of the task to be monitored to the monitored task number register 7 via the host communication circuit 13. In the first embodiment, the task number “5” of the task TE is written. Note that this task number is input to the host computer 1 in advance by a user such as a programmer via an input device or the like connected to the host computer 1. And the emulator device is the target CP
Resume execution of U1.

【0019】次に、ステップST2において、タスクコ
ントロールブロック監視回路3は、ターゲットメモリ2
内に格納された図3に示すタスクコントロールブロック
22に記録された全タスクTE,TA,TB,TCおよ
びTDの中から任意の状態からREADY状態に遷移し
たタスクを探し出す。例えば、監視対象であるタスクT
EがWAIT状態からREADY状態へ遷移したとする
と、OSはタスクレディキューの終わりにタスクTEを
繋ぎ、タスクコントロールブロック22に記録されたタ
スクTEの状態をWAIT状態からREADY状態に変
更する。すると、タスクコントロールブロック監視回路
3はタスクコントロールブロック22に記録された全タ
スクの中からタスクTEを探し出し、このタスクTEの
タスク番号“5”を出力する。
Next, in step ST2, the task control block monitoring circuit 3
A task that has transitioned from any state to the READY state is searched for from all the tasks TE, TA, TB, TC, and TD recorded in the task control block 22 shown in FIG. For example, the task T to be monitored
Assuming that E transitions from the WAIT state to the READY state, the OS connects the task TE at the end of the task ready queue, and changes the state of the task TE recorded in the task control block 22 from the WAIT state to the READY state. Then, the task control block monitoring circuit 3 searches for the task TE from all the tasks recorded in the task control block 22, and outputs the task number “5” of the task TE.

【0020】このようにして、タスクコントロールブロ
ック監視回路3がREADY状態へ遷移したタスクを探
し出すと、コンパレータ5は、ステップST3におい
て、ステップST2において探し出されたタスクのタス
ク番号と監視対象タスク番号レジスタ7に書き込まれて
いるタスク番号とを比較し、それらが一致するか否かを
判定する。判定の結果、もしそれらが一致するならばス
テップST4に進み、一致しないならばステップST2
に戻る。この際、上記のように、タスクコントロールブ
ロック監視回路3によって探し出されたタスクがタスク
TEであるならば、そのタスク番号“5”は監視対象タ
スク番号レジスタ7に書き込まれたタスク番号と一致す
るのでステップST4へ移行する。
In this way, when the task control block monitoring circuit 3 searches for a task that has transitioned to the READY state, the comparator 5 determines in step ST3 the task number of the task found in step ST2 and the monitoring target task number register. 7 is compared with the task number written in 7 to determine whether they match. As a result of the determination, if they match, the process proceeds to step ST4, and if they do not match, the process proceeds to step ST2.
Return to At this time, if the task found by the task control block monitoring circuit 3 is the task TE as described above, the task number “5” matches the task number written in the monitoring target task number register 7. Therefore, the process proceeds to step ST4.

【0021】ステップST2において探し出されたタス
クのタスク番号と監視対象タスク番号レジスタ7に書き
込まれているタスク番号とが一致すると、ステップST
4において、コンパレータ5はスタート信号を時間計測
ストップウォッチ8へ出力し時間計測を開始する。そし
て、ステップST5において、RUN状態タスク監視回
路4はOSによって書き込まれたターゲットメモリ2内
のRUN状態タスク番号21から現在RUN状態にある
タスクのタスク番号を得る。この場合、タスクレディキ
ューには図2に示すような複数のタスクTA,TB,T
CおよびTDが繋がれた状態で実行待ちをしており、さ
らに、タスクTDの後には、上記したように監視対象で
あるタスクTEが繋がれている。それ故、RUN状態タ
スク監視回路4はまず先頭にあるタスクTAのタスク番
号“1”を取得する。そして、ステップST6におい
て、コンパレータ6がステップST5においてRUN状
態タスク監視回路4が取得したタスク番号と監視対象タ
スク番号レジスタ7に書き込まれているタスク番号とを
比較し、それらが一致するか否かを判定する。判定の結
果、もしそれらが一致するならばステップST7に進
み、一致しないならばステップST5に戻る。この場
合、RUN状態タスク監視回路4がまず得たタスク番号
は“1”であり、監視対象タスク番号レジスタ7に書き
込まれたタスク番号は“5”であるのでステップST5
に戻る。
If the task number of the task found in step ST2 matches the task number written in the monitoring target task number register 7, the process proceeds to step ST2.
At 4, the comparator 5 outputs a start signal to the time measurement stopwatch 8 to start time measurement. Then, in step ST5, the RUN state task monitoring circuit 4 obtains the task number of the task currently in the RUN state from the RUN state task number 21 in the target memory 2 written by the OS. In this case, a plurality of tasks TA, TB, T as shown in FIG.
C and TD are connected and waiting for execution, and after the task TD, the task TE to be monitored is connected as described above. Therefore, the RUN status task monitoring circuit 4 first obtains the task number “1” of the task TA at the head. Then, in step ST6, the comparator 6 compares the task number obtained by the RUN status task monitoring circuit 4 in step ST5 with the task number written in the monitoring target task number register 7, and determines whether or not they match. judge. As a result of the determination, if they match, the process proceeds to step ST7, and if they do not match, the process returns to step ST5. In this case, the task number obtained first by the RUN status task monitoring circuit 4 is “1”, and the task number written in the monitoring target task number register 7 is “5”, so that the step ST5
Return to

【0022】次に、ターゲットCPU1がタスク番号
“1”を有するタスクTAを処理し終えると、OSはタ
スクレディキューの先頭にあるタスクTAに関する情報
(タスク番号)を削除し、以下に繋がれたタスクを1つ
ずつシフトする。その後、ターゲットCPU1がタスク
TB,TCおよびTDを順次処理する間に、RUN状態
タスク監視回路4は同様に先頭のタスクのタスク番号で
ある“2”,“3”および“4”を順次得る。この間、
これらのタスク番号は、監視対象タスク番号レジスタ7
に書き込まれているタスク番号と一致しないので、ステ
ップST7には進まず、ステップST5〜ST6を繰り
返すこととなる。
Next, when the target CPU 1 finishes processing the task TA having the task number "1", the OS deletes information (task number) relating to the task TA at the head of the task ready queue, and is connected as follows. Shift tasks one by one. Thereafter, while the target CPU 1 sequentially processes the tasks TB, TC and TD, the RUN status task monitoring circuit 4 similarly obtains the task numbers "2", "3" and "4" of the first task in the same manner. During this time,
These task numbers are stored in the monitoring target task number register 7.
Does not match the task number written in step ST7, the process does not proceed to step ST7, and steps ST5 to ST6 are repeated.

【0023】このようにしてターゲットCPU1がタス
クTB,TCおよびTDを処理し終えると、OSはタス
クTEをREADY状態からRUN状態に遷移させる。
OSは図3に示すRUN状態タスク番号21にタスクT
Eのタスク番号“5”を書き込み、このタスク番号のタ
スクTEの処理を開始する。この結果、RUN状態タス
ク監視回路4はタスクレディキューの先頭にあるタスク
TEのタスク番号“5”を取得するので、ステップST
6の条件が真となりステップST7へ進む。そして、ス
テップST7において、コンパレータ6はストップ信号
を時間計測ストップウォッチ8へ出力し時間計測を停止
する。その後、エミュレータコントロールCPU12
は、ステップST8において、時間計測ストップウォッ
チ8の時間計測結果をトレースメモリ9に書き込み、監
視対象のタスクがREADY状態に遷移した瞬間からR
UN状態に遷移した瞬間までに経過した時間の計測処理
を終了する。その後、ホスト計算機10はトレースメモ
リ9に書き込まれた時間計測結果をホスト通信回路13
を介して任意に読み取ることができる。また、読み取ら
れた時間計測結果はプログラマ等のユーザに提示するた
めにホスト計算機10の表示装置に表示されるか、もし
くは、ホスト計算機10内の記憶装置に保存される。
When the target CPU 1 finishes processing the tasks TB, TC and TD in this way, the OS causes the task TE to transition from the READY state to the RUN state.
The OS sends the task T to the RUN status task number 21 shown in FIG.
The task number “5” of E is written, and the processing of the task TE of this task number is started. As a result, the RUN state task monitoring circuit 4 obtains the task number “5” of the task TE at the head of the task ready queue, so that the step ST
The condition of No. 6 becomes true, and the process proceeds to Step ST7. Then, in step ST7, the comparator 6 outputs a stop signal to the time measurement stopwatch 8 to stop the time measurement. Then, the emulator control CPU 12
In step ST8, the time measurement result of the time measurement stopwatch 8 is written into the trace memory 9, and from the moment the monitored task transitions to the READY state, R
The measurement processing of the time elapsed until the moment when the state transits to the UN state is ended. After that, the host computer 10 compares the time measurement result written in the trace memory 9 with the host communication circuit 13.
Can be read arbitrarily through. The read time measurement result is displayed on a display device of the host computer 10 for presentation to a user such as a programmer, or is stored in a storage device in the host computer 10.

【0024】以上のように、この実施の形態1によれ
ば、OSのもとで実行されるプログラムをデバッグする
際に監視対象となっているタスクがREADY状態に遷
移する瞬間からRUN状態に遷移する瞬間までに経過し
た時間をリアルタイムで計測することができる効果を奏
する。これにより、プログラマ等のユーザはこのような
時間計測結果をもとに、タスクのオーバヘッドを少なく
するための措置を講じ、タスク起動を保証できるプログ
ラムを開発することが可能となる。
As described above, according to the first embodiment, when a program executed under the OS is debugged, the task to be monitored transitions from the moment when the task transitions to the READY state to the RUN state. This has the effect of measuring the time elapsed until the moment when it is performed in real time. As a result, a user such as a programmer can take measures to reduce the task overhead based on the time measurement result, and develop a program that can guarantee task activation.

【0025】[0025]

【発明の効果】以上のように、請求項1記載の発明によ
れば、エミュレーション制御方法を、タスク情報を監視
することによりREADY状態に遷移したタスクを探し
出し、探し出したタスクが予め定めた監視対象のタスク
であるならば時間計測を開始し、監視対象のタスクがR
UN状態になったことを検出すると時間計測を停止し
て、監視対象のタスクがREADY状態になった瞬間か
らRUN状態になる瞬間までに経過した時間を計測する
ように構成したので、監視対象となっているタスクがR
EADY状態に遷移する瞬間からRUN状態に遷移する
瞬間までに経過した時間をリアルタイムで計測すること
ができる効果がある。また、これにより、プログラマ等
のユーザはこのような時間計測結果をもとに、タスクの
オーバヘッドを少なくするための措置を講じ、タスク起
動を保証できるプログラムを開発することができる効果
がある。
As described above, according to the first aspect of the present invention, the emulation control method searches for a task that has transitioned to the READY state by monitoring task information, and the searched task determines a predetermined monitoring target. If it is a task, start time measurement, and if the task to be monitored is R
Since the time measurement is stopped when detecting the change to the UN state, and the time elapsed from the moment when the task to be monitored changes to the READY state to the moment to change to the RUN state is configured. Task is R
There is an effect that the time elapsed from the moment of transition to the EADY state to the moment of transition to the RUN state can be measured in real time. This also has the effect that a user such as a programmer can take measures to reduce the task overhead based on the time measurement result and develop a program that can guarantee task activation.

【0026】請求項2記載の発明によれば、エミュレー
ション制御方法を、上記のようにして経過した時間を計
測した後、計測した経過時間を一旦エミュレータ装置内
に記録するように構成したので、監視対象となっている
タスクがREADY状態に遷移する瞬間からRUN状態
に遷移する瞬間までに経過した時間をリアルタイムで計
測し、これをプログラマ等のユーザにホスト計算機を介
して提示するために計測した経過時間を記録することが
できる効果がある。
According to the second aspect of the present invention, the emulation control method is configured to measure the elapsed time as described above and then temporarily record the measured elapsed time in the emulator device. The elapsed time from the moment when the target task transitions to the READY state to the moment when the task transitions to the RUN state is measured in real time, and the elapsed time is measured for presentation to the user such as a programmer via the host computer. There is an effect that time can be recorded.

【0027】請求項3記載の発明によれば、エミュレー
タ装置を、タスクコントロールブロック監視手段が探し
出したタスクが予め定めた監視対象のタスクであるなら
ば時間計測を開始し、RUN状態タスク監視手段が監視
対象のタスクがRUN状態であることを検出すると時間
計測を停止して、監視対象のタスクがREADY状態に
なった瞬間からRUN状態になる瞬間までに経過した時
間を計測する時間計測手段とを備えるように構成したの
で、監視対象となっているタスクがREADY状態に遷
移する瞬間からRUN状態に遷移する瞬間までに経過し
た時間をリアルタイムで計測することができる効果があ
る。また、これにより、プログラマ等のユーザはこのよ
うな時間計測結果をもとに、タスクのオーバヘッドを少
なくするための措置を講じ、タスク起動を保証できるプ
ログラムを開発することができる効果がある。
According to the third aspect of the present invention, if the task found by the task control block monitoring means is a predetermined monitoring target task, the emulator apparatus starts time measurement, and the RUN status task monitoring means sets When detecting that the task to be monitored is in the RUN state, the time measurement is stopped, and time measuring means for measuring the time elapsed from the moment when the task to be monitored enters the RUN state until the moment when the task to be monitored enters the RUN state. Since the monitoring target is provided, there is an effect that the time elapsed from the moment when the task to be monitored changes to the READY state to the moment when the task changes to the RUN state can be measured in real time. This also has the effect that a user such as a programmer can take measures to reduce the task overhead based on the time measurement result and develop a program that can guarantee task activation.

【0028】請求項4記載の発明によれば、エミュレー
タ装置を、時間計測手段により計測された経過時間を記
録するトレースメモリを備えるように構成したので、監
視対象となっているタスクがREADY状態に遷移する
瞬間からRUN状態に遷移する瞬間までに経過した時間
をリアルタイムで計測し、これをプログラマ等のユーザ
にホスト計算機を介して提示するために計測した経過時
間を記録することができる効果がある。
According to the fourth aspect of the present invention, since the emulator device is provided with the trace memory for recording the elapsed time measured by the time measuring means, the task to be monitored is in the READY state. There is an effect that the elapsed time from the moment of transition to the moment of transition to the RUN state is measured in real time, and the elapsed time measured for presenting this to a user such as a programmer via a host computer can be recorded. .

【0029】請求項5記載の発明によれば、エミュレー
タ装置を、時間計測手段がタスクコントロールブロック
監視手段の出力するタスク番号が監視対象タスク番号レ
ジスタに保持されたタスク番号と一致する場合に時間計
測を開始し、タスク番号監視手段の出力するタスク番号
が監視対象タスク番号レジスタに保持されたタスク番号
と一致する場合に時間計測を停止するように構成したの
で、監視対象となっているタスクがREADY状態に遷
移する瞬間からRUN状態に遷移する瞬間までに経過し
た時間をリアルタイムで計測することができる効果があ
る。
According to the fifth aspect of the present invention, the emulator device measures the time when the task number output from the task control block monitoring means matches the task number held in the monitoring target task number register. Is started, and when the task number output from the task number monitoring means matches the task number held in the monitoring target task number register, the time measurement is stopped, so that the monitoring target task is ready. There is an effect that the time elapsed from the moment of transition to the state to the moment of transition to the RUN state can be measured in real time.

【0030】請求項6記載の発明によれば、エミュレー
タ装置を、時間計測手段がタスクコントロールブロック
監視手段の出力するタスク番号と監視対象のタスクのタ
スク番号とが一致する場合にスタート信号を出力する第
1のコンパレータと、RUN状態タスク監視手段が出力
するタスク番号と監視対象のタスクのタスク番号とが一
致する場合にストップ信号を出力する第2のコンパレー
タと、スタート信号に応答して時間計測を開始しストッ
プ信号に応答して前記時間計測を停止する時間計測スト
ップウォッチとを備えるように構成したので、監視対象
となっているタスクがREADY状態に遷移する瞬間か
らRUN状態に遷移する瞬間までに経過した時間をリア
ルタイムで計測することができる効果がある。
According to the sixth aspect of the present invention, the emulator device outputs the start signal when the task number output by the task control block monitoring means and the task number of the task to be monitored coincide with each other by the time measuring means. A first comparator, a second comparator that outputs a stop signal when the task number output by the RUN status task monitoring means matches the task number of the task to be monitored, and a time measurement in response to the start signal. A time measurement stopwatch that starts and stops the time measurement in response to the stop signal is provided, so that the task to be monitored changes from the moment of transition to the READY state to the moment of transition to the RUN state. There is an effect that the elapsed time can be measured in real time.

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

【図1】 この発明の実施の形態1によるエミュレーシ
ョン制御方法を実現するエミュレータ装置の構成を示す
ブロック図である。
FIG. 1 is a block diagram illustrating a configuration of an emulator device that implements an emulation control method according to a first embodiment of the present invention.

【図2】 OSによって管理されるタスクレディキュー
の状態を示す説明図である。
FIG. 2 is an explanatory diagram showing a state of a task ready queue managed by an OS.

【図3】 OSによって管理されるターゲットメモリ2
内のタスク情報を示す説明図である。
FIG. 3 shows a target memory 2 managed by the OS.
FIG. 4 is an explanatory diagram showing task information in the submenu.

【図4】 この発明の実施の形態1によるエミュレーシ
ョン制御方法の処理の流れを示すフローチャートであ
る。
FIG. 4 is a flowchart showing a process flow of an emulation control method according to the first embodiment of the present invention.

【図5】 従来のエミュレーション制御方法を実現する
エミュレータ装置の構成を示すブロック図である。
FIG. 5 is a block diagram illustrating a configuration of an emulator device that implements a conventional emulation control method.

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

1 ターゲットCPU、3 タスクコントロールブロッ
ク監視回路(タスクコントロールブロック監視手段)、
4 RUN状態タスク監視回路(RUN状態タスク監視
手段)、5,6 コンパレータ(時間計測手段)、7
監視対象タスク番号レジスタ、8 時間計測ストップウ
ォッチ(時間計測手段)、9 トレースメモリ、11
エミュレータ装置。
1 target CPU, 3 task control block monitoring circuit (task control block monitoring means),
4 RUN status task monitoring circuit (RUN status task monitoring means), 5, 6 comparator (time measuring means), 7
Monitored task number register, 8 time stopwatch (time measuring means), 9 trace memory, 11
Emulator device.

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 ターゲットCPUがデバッグ対象のプロ
グラムを実行する際にタスク情報を監視することにより
READY状態に遷移したタスクを探し出し、探し出し
たタスクが予め定めた監視対象のタスクであるならば時
間計測を開始し、RUN状態のタスクを監視することに
より前記監視対象のタスクがRUN状態になったことを
検出すると前記時間計測を停止して、前記監視対象のタ
スクのREADY状態になった瞬間からRUN状態にな
る瞬間までに経過した時間を計測するエミュレーション
制御方法。
When a target CPU executes a program to be debugged, it monitors task information to search for a task that has transitioned to a READY state, and if the searched task is a predetermined task to be monitored, time measurement is performed. Is started, and when it is detected that the task to be monitored is in the RUN state by monitoring the task in the RUN state, the time measurement is stopped, and RUN is started from the moment when the monitored task enters the READY state. An emulation control method that measures the time that has elapsed until the moment when the state is reached.
【請求項2】 監視対象のタスクのREADY状態にな
った瞬間からRUN状態になる瞬間までに経過した時間
を計測した後、計測した前記経過時間を一旦エミュレー
タ装置内に記録することを特徴とする請求項1記載のエ
ミュレーション制御方法。
2. The method according to claim 1, wherein the elapsed time from the moment when the task to be monitored enters the READY state to the moment when the task enters the RUN state is measured, and the measured elapsed time is temporarily recorded in the emulator device. The emulation control method according to claim 1.
【請求項3】 ターゲットCPUがデバッグ対象のプロ
グラムを実行する際にタスクコントロールブロックを監
視することによりREADY状態に遷移したタスクを探
し出すタスクコントロールブロック監視手段と、RUN
状態のタスクを監視するRUN状態タスク監視手段と、
前記タスクコントロールブロック監視手段が探し出した
タスクが予め定めた監視対象のタスクであるならば時間
計測を開始し、前記RUN状態タスク監視手段が前記監
視対象のタスクがRUN状態であることを検出すると前
記時間計測を停止して、前記監視対象のタスクがREA
DY状態になった瞬間からRUN状態になる瞬間までに
経過した時間を計測する時間計測手段とを備えたエミュ
レータ装置。
3. A task control block monitoring means for monitoring a task control block when a target CPU executes a program to be debugged, thereby searching for a task that has transitioned to a READY state, and a RUN.
RUN status task monitoring means for monitoring status tasks;
When the task found by the task control block monitoring means is a predetermined monitoring target task, time measurement is started, and when the RUN state task monitoring means detects that the monitoring target task is in the RUN state, Stop the time measurement and the monitored task
An emulator device comprising: a time measuring means for measuring a time elapsed from the moment when the DY state is entered to the moment when the RUN state is entered.
【請求項4】 時間計測手段により計測された、監視対
象のタスクのREADY状態になった瞬間からRUN状
態になる瞬間までに経過した時間を記録するトレースメ
モリを備えたことを特徴とする請求項3記載のエミュレ
ータ装置。
4. A trace memory for recording the time elapsed from the moment when the task to be monitored enters the READY state to the moment when it enters the RUN state, measured by the time measuring means. 3. The emulator device according to 3.
【請求項5】 タスクコントロールブロック監視手段が
監視すべきタスクのタスク番号を保持する監視対象タス
ク番号レジスタをさらに備えており、前記タスクコント
ロールブロック監視手段はタスクコントロールブロック
を監視することによりREADY状態に遷移したタスク
を探し出すとそのタスク番号を出力し、RUN状態タス
ク監視手段はRUN状態のタスクのタスク番号を監視し
そのタスク番号を出力し、時間計測手段は前記タスクコ
ントロールブロック監視手段の出力するタスク番号が前
記監視対象タスク番号レジスタに保持されたタスク番号
に一致する場合に時間計測を開始し、前記タスク番号監
視手段の出力するタスク番号が前記監視対象タスク番号
レジスタに保持されたタスク番号に一致する場合に前記
時間計測を停止することを特徴とする請求項3または請
求項4記載のエミュレータ装置。
5. A monitoring target task number register for holding a task number of a task to be monitored by the task control block monitoring means, wherein the task control block monitoring means monitors a task control block to enter a READY state. When the transitioned task is found, the task number is output. The RUN state task monitoring means monitors the task number of the RUN state task and outputs the task number. The time measurement means outputs the task control block monitoring means. When the number matches the task number stored in the monitored task number register, time measurement is started, and the task number output by the task number monitoring means matches the task number stored in the monitored task number register. Stop the time measurement when The emulator according to claim 3 or 4, wherein
【請求項6】 時間計測手段は、タスクコントロールブ
ロック監視手段が出力するタスク番号と監視対象タスク
番号レジスタの保持するタスク番号とを比較しそれらが
一致するとスタート信号を出力する第1のコンパレータ
と、RUN状態タスク監視手段が出力するタスク番号と
前記監視対象タスク番号レジスタの保持するタスク番号
とを比較しそれらが一致するとストップ信号を出力する
第2のコンパレータと、前記スタート信号に応答して時
間計測を開始し前記ストップ信号に応答して前記時間計
測を停止する時間計測ストップウォッチとを備えたこと
を特徴とする請求項5記載のエミュレータ装置。
6. The time measuring means compares a task number output by the task control block monitoring means with a task number held in a monitoring target task number register, and outputs a start signal when they match, A task number output by the RUN status task monitoring means is compared with a task number held in the monitored task number register, and when they match, a second comparator which outputs a stop signal, and time measurement in response to the start signal 6. The emulator device according to claim 5, further comprising: a time measurement stopwatch that starts the time measurement and stops the time measurement in response to the stop signal.
JP9163101A 1997-06-19 1997-06-19 Emulation control method and emulator Pending JPH1115704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9163101A JPH1115704A (en) 1997-06-19 1997-06-19 Emulation control method and emulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9163101A JPH1115704A (en) 1997-06-19 1997-06-19 Emulation control method and emulator

Publications (1)

Publication Number Publication Date
JPH1115704A true JPH1115704A (en) 1999-01-22

Family

ID=15767200

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9163101A Pending JPH1115704A (en) 1997-06-19 1997-06-19 Emulation control method and emulator

Country Status (1)

Country Link
JP (1) JPH1115704A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument
JP2012133752A (en) * 2010-11-29 2012-07-12 Denso Corp Microcomputer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008305238A (en) * 2007-06-08 2008-12-18 Denso Corp Measuring instrument
JP2012133752A (en) * 2010-11-29 2012-07-12 Denso Corp Microcomputer

Similar Documents

Publication Publication Date Title
US7742905B2 (en) Method and system for dynamically adjusting speed versus accuracy of computer platform simulation
JP3684831B2 (en) Microcomputer, electronic equipment and debugging system
US6175914B1 (en) Processor including a combined parallel debug and trace port and a serial port
US5383192A (en) Minimizing the likelihood of slip between the instant a candidate for a break event is generated and the instant a microprocessor is instructed to perform a break, without missing breakpoints
US7636870B2 (en) Semiconductor integrated circuit device, and debugging system and method for the semiconductor integrated circuit device
US7716031B2 (en) Interface converter for unified view of multiple computer system simulations
EP0084431A2 (en) Monitoring computer systems
CN102360329A (en) Bus monitoring and debugging control device and methods for monitoring and debugging bus
US7404178B2 (en) ROM-embedded debugging of computer
CN202267954U (en) Bus monitoring and debugging control device
JP3206641B2 (en) Microcomputer system debugging method, debugging device, and recording medium recording debug program
JPH11110255A (en) Software debugging device and method
JPH1115704A (en) Emulation control method and emulator
US20110107072A1 (en) Method for self-diagnosing system management interrupt handler
JPH10254738A (en) Emulator device and emulation method
CN110569184A (en) test method and terminal equipment
US7089468B2 (en) Program-controlled unit and method for identifying and/or analyzing errors in program-controlled units
JP2005165825A (en) Trace information recorder
JP2006202102A (en) Simulation apparatus
JP2930028B2 (en) Semiconductor test method and apparatus
JP5277893B2 (en) Debugging support apparatus and debugging support method
WO2006093762A1 (en) Computer platform simulation
JPH11102306A (en) Emulator
JP2967741B2 (en) CPU compatibility test equipment
SE524799C2 (en) Debugging method for single or multi process real time systems, identifies significant event break off point with unique marker comprising check sum