JP2007264856A - Cpu monitoring system, device and method - Google Patents
Cpu monitoring system, device and method Download PDFInfo
- Publication number
- JP2007264856A JP2007264856A JP2006086785A JP2006086785A JP2007264856A JP 2007264856 A JP2007264856 A JP 2007264856A JP 2006086785 A JP2006086785 A JP 2006086785A JP 2006086785 A JP2006086785 A JP 2006086785A JP 2007264856 A JP2007264856 A JP 2007264856A
- Authority
- JP
- Japan
- Prior art keywords
- cpu
- task
- executed
- count value
- reset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、CPU(中央処理装置)の実行状況を監視するCPU監視システム、装置、及び方法に関する。 The present invention relates to a CPU monitoring system, apparatus, and method for monitoring the execution status of a CPU (central processing unit).
従来から、CPUの実行状況を監視するためにウォッチドッグタイマが用いられている。ここで、ウォッチドッグタイマとは、一定時間毎に計時のためのカウンタをリセットする機能を備え、所定の期間内にカウンタがリセットされないときにはCPUをリセットするものである。かかるウォッチドックタイマを用いてCPUを常時監視することにより、暴走した状態にあるCPUを復帰させることが可能となる。 Conventionally, a watchdog timer is used to monitor the execution status of the CPU. Here, the watchdog timer has a function of resetting a counter for counting at regular intervals, and resets the CPU when the counter is not reset within a predetermined period. By constantly monitoring the CPU using such a watchdog timer, it is possible to restore the CPU in a runaway state.
図3は、ウォッチドッグタイマを用いた従来のCPU監視方法の一例を示すタイミングチャートである。図3に示す通り、従来は、監視対象であるCPU100の外部に外付けウォッチドッグタイマ(以下、WDTという)101を設け、この外付けWDT101を用いてCPU100の実行状況を監視している。いま、CPU100にて、AタスクTS11及びBタスクTS12の2つのタスクと、外付けWDT101を定期的にクリアするためのタスク(WDTタスクTS13)とが実行される場合を考える。尚、これらのタスクのうち、AタスクTS11の優先度が最も高く、次にBタスクTS12の優先度が高く、WDTタスクTS13の優先度が最も低いとする。
FIG. 3 is a timing chart showing an example of a conventional CPU monitoring method using a watchdog timer. As shown in FIG. 3, conventionally, an external watchdog timer (hereinafter referred to as WDT) 101 is provided outside the
図3に示す通り、CPU100は、AタスクTS11及びBタスクTS12並びにWDTタスクTS13を時分割で実行する。ここで、AタスクTS11及びBタスクTS12は、WDTタスクTS13よりも優先度が高いため、WDTタスクTS13に優先して実行される。WDTタスクTS13は一定時間毎に実行され、WDTタスクTS13の実行により外付けWDT101のカウンタがクリアされる。WDTタスクTS13は、例えば3秒程度の時間間隔で実行される。よって、外付けWDT101のカウンタがクリアされる時間間隔T11,T12は3秒程度である。
As shown in FIG. 3, the
いま、外付けWDT101のカウンタがクリアされた後にAタスクTS11が実行され、このAタスクTS11が何らかの原因で暴走した場合を考える。前述の通り、AタスクTS11は最も優先度が高いため、AタスクTS11が暴走してしまうとAタスクTS11がCPU100を占有してしまう。このため、WDTタスクTS13が実行されず、外付けWDT101のカウンタはクリアされず外付けWDT101のカウンタがカウントアップされ続ける。そして、外付けWDT101のカウンタをクリアしてから所定期間T13(例えば、10秒程度)が経過すると、外付けWDT101はタイムアウトとなり、CPU100に対してリセット信号を出力する。これにより、CPU100がリセットされる。
Assume that the A task TS11 is executed after the counter of the
また、以下の特許文献1には、実行対象となるタスクの切替えの際に退避・保存、復帰・設定していた各タスクのコンテキスト情報に加えて暴走検出用タイマーカウント値・情報を合わせて退避・復帰することで、タスクの暴走検出を行う方法及び装置が提案されている。
ところで、図3を用いて説明した従来のCPU監視方法では、外付けWDT101を用いてCPU100の監視を行っている。ここで、WDTを内蔵したCPUも存在するが、内蔵のWDTは定期的に行われるリセット(カウンタのリセット)の時間間隔が1.5秒程度と短かく、暴走に至るような状況でなくとも一時的な負荷によりリセットが実施できないことがある。このため、図3に示す例では、定期的に行われるリセットの時間間隔がより長い外付けWDTを設けている。しかしながら、外付けWDTを設けると、回路が複雑になるとともにコストが上昇してしまうという問題があった。
Incidentally, in the conventional CPU monitoring method described with reference to FIG. 3, the
また、従来は、外付けWDT101のタイムアウトによりCPU100をリセットしているが、CPU100がリセットされた時点で待避・保存されるタスクに関する情報はほとんどない。このため、CPU100がリセットされた後でリセットが生じた原因を追求するのに時間を要し、デバッグを行うのが困難であるという問題があった。
Conventionally, the
本発明は、上記事情に鑑みてなされたものであり、回路の簡略化及びコスト削減を図れるとともに容易に障害の発生原因を追求することができるCPU監視システム、装置、及び方法を提供することを目的とする。 The present invention has been made in view of the above circumstances, and provides a CPU monitoring system, apparatus, and method capable of simplifying the circuit and reducing the cost and easily pursuing the cause of the failure. Objective.
上記課題を解決するために、本発明のCPU監視システムは、ウォッチドッグタイマを備えるCPUの実行状況を監視するCPU監視システムにおいて、カウントを行うカウント手段と、第1の所定時間毎に、前記カウント手段にカウントさせるとともに前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込み手段と、前記第1の所定期間よりも長い第2の所定時間毎に、前記カウント手段のカウント値をクリアするリセット手段とを備えることを特徴としている。
上記課題を解決するために、本発明のCPU監視システムは、ウォッチドッグタイマを備えるCPUの実行状況を監視するCPU監視システムにおいて、カウントを行うカウント手段と、前記カウント手段にカウントさせ、前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込みルーチンを第1の所定時間毎に実行させるとともに、前記カウント手段のカウント値をクリアするリセットタスクを前記第1の所定期間よりも長い第2の所定時間毎に実行させるタスク制御手段とを備えることを特徴としている。
ここで、本発明のCPU監視システムは、前記割り込みルーチンが、前記CPUで実行されるタスクの優先度に拘わらず実行可能であり、前記リセットタスクは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されていることを特徴としている。
また、本発明のCPU監視システムは、前記タスク制御手段が、前記リセットタスク以外のタスクを実行させる場合には、実行開始時にフラグをセットし、実行終了時にセットしたフラグをクリアする制御を行うことを特徴としている。
更に、本発明のCPU監視システムは、前記割り込みルーチンが、前記カウント手段のカウント値が前記所定値よりも大である場合には、前記フラグがセットされているタスクに関する情報を待避することを特徴としている。
上記課題を解決するために、本発明のCPU監視装置は、ウォッチドッグタイマを備えるCPUの実行状況を監視するCPU監視装置において、カウントを行うカウント手段と、第1の所定時間毎に、前記カウント手段にカウントさせるとともに前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込み手段と、前記第1の所定期間よりも長い第2の所定時間毎に、前記カウント手段のカウント値をクリアするリセット手段とを備えることを特徴としている。
また、本発明のCPU監視装置は、ウォッチドッグタイマを備えるCPUの実行状況を監視するCPU監視装置において、カウントを行うカウント手段と、前記カウント手段にカウントさせ、前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込みルーチンを第1の所定時間毎に実行させるとともに、前記カウント手段のカウント値をクリアするリセットタスクを前記第1の所定期間よりも長い第2の所定時間毎に実行させるタスク制御手段とを備えることを特徴としている。
更に、本発明のCPU監視装置は、前記割り込みルーチンは、前記CPUで実行されるタスクの優先度に拘わらず実行可能であり、前記リセットタスクは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されていることを特徴としている。
上記課題を解決するために、本発明のCPU監視方法は、ウォッチドッグタイマを備えるCPUの実行状況を監視するCPU監視方法において、第1の所定時間毎にカウント手段によりカウントを行う第1ステップと、前記第1の所定期間よりも長い第2の所定時間毎に前記カウント手段のカウント値をクリアする第2ステップと、前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする第3ステップとを含むことを特徴としている。
また、本発明のCPU監視方法は、前記第1ステップが、前記CPUで実行されるタスクの優先度に拘わらず実行され、前記第2ステップは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されて実行されることを特徴としている。
また、本発明のCPU監視方法は、前記CPUでタスクを実行させるときに実行開始時にフラグをセットするステップと、前記タスクの実行終了時にセットしたフラグをクリアするステップとを含むことを特徴としている。
更に、本発明のCPU監視方法は、前記カウント手段のカウント値が前記所定値よりも大である場合には、前記フラグがセットされているタスクに関する情報を待避する第4ステップを含むことを特徴としている。
In order to solve the above-described problem, a CPU monitoring system according to the present invention is a CPU monitoring system that monitors the execution status of a CPU having a watchdog timer. Means for counting and interrupting means for clearing the watchdog timer when the count value of the counting means is within a predetermined value, and for each second predetermined time longer than the first predetermined period, the count And reset means for clearing the count value of the means.
In order to solve the above problems, a CPU monitoring system according to the present invention is a CPU monitoring system that monitors the execution status of a CPU including a watchdog timer. When the count value is within a predetermined value, an interrupt routine for clearing the watchdog timer is executed every first predetermined time, and a reset task for clearing the count value of the counting means is executed in the first predetermined value. And a task control unit that is executed every second predetermined time longer than the period.
Here, in the CPU monitoring system of the present invention, the interrupt routine can be executed regardless of the priority of the task executed by the CPU, and the reset task is the most of the tasks executed by the CPU. It is characterized by a low priority.
In the CPU monitoring system of the present invention, when the task control means causes a task other than the reset task to be executed, a control is performed to set a flag at the start of execution and clear the flag set at the end of execution. It is characterized by.
Furthermore, the CPU monitoring system of the present invention is characterized in that, when the count value of the counting means is larger than the predetermined value, the interrupt routine saves information on a task for which the flag is set. It is said.
In order to solve the above-described problem, a CPU monitoring device according to the present invention is a CPU monitoring device that monitors the execution status of a CPU including a watchdog timer. The CPU monitoring device counts the counting unit for each first predetermined time. Means for counting and interrupting means for clearing the watchdog timer when the count value of the counting means is within a predetermined value, and for each second predetermined time longer than the first predetermined period, the count And reset means for clearing the count value of the means.
The CPU monitoring device of the present invention is a CPU monitoring device that monitors the execution status of a CPU having a watchdog timer. The CPU monitoring device counts the counting means, and the counting means counts the count value of the counting means. If not, an interrupt routine for clearing the watchdog timer is executed every first predetermined time, and a reset task for clearing the count value of the counting means is set to a second time longer than the first predetermined period. And a task control unit that is executed every predetermined time.
Furthermore, in the CPU monitoring device of the present invention, the interrupt routine can be executed regardless of the priority of the task executed by the CPU, and the reset task is the lowest of the tasks executed by the CPU. It is characterized in that priority is set.
In order to solve the above-mentioned problem, a CPU monitoring method of the present invention is a CPU monitoring method for monitoring an execution status of a CPU including a watchdog timer, wherein a first step of performing counting by a counting means every first predetermined time; A second step of clearing the count value of the counting means every second predetermined time longer than the first predetermined period, and the watchdog timer if the count value of the counting means is within a predetermined value And a third step of clearing.
In the CPU monitoring method of the present invention, the first step is executed regardless of the priority of the task executed by the CPU, and the second step is the lowest task among the tasks executed by the CPU. It is characterized in that the priority is set and executed.
The CPU monitoring method of the present invention includes a step of setting a flag at the start of execution when the CPU executes a task, and a step of clearing the flag set at the end of execution of the task. .
Furthermore, the CPU monitoring method of the present invention includes a fourth step of evacuating information relating to the task for which the flag is set when the count value of the counting means is larger than the predetermined value. It is said.
本発明によれば、第1の所定時間毎にカウント手段によりカウントを行い、第1の所定期間よりも長い第2の所定時間毎にカウント手段のカウント値をクリアし、カウント手段のカウント値が所定値以内である場合にはウォッチドッグタイマをクリアし、カウント値が所定値よりも大きい場合にはウォッチドッグタイマをクリアしていないため、外付けのウォッチドックタイマが無くともCPUの監視を行うことができる。これにより、回路の簡略化及びコスト削減を図ることができる。
また、CPUでタスクを実行させるときに実行開始時にフラグをセットし、タスクの実行終了時にセットしたフラグをクリアしているため、暴走等によりフラグがセットされたままのタスクを容易に特定することができる。また、フラグがセットされたままのタスクに関する情報を待避することにより、容易に障害の発生原因を追求することができる。
According to the present invention, the counting means counts every first predetermined time, the count value of the counting means is cleared every second predetermined time longer than the first predetermined period, and the count value of the counting means is The watchdog timer is cleared when it is within the predetermined value, and the watchdog timer is not cleared when the count value is larger than the predetermined value, so the CPU is monitored even without an external watchdog timer. be able to. As a result, the circuit can be simplified and the cost can be reduced.
In addition, when a task is executed by the CPU, a flag is set at the start of execution, and the flag set at the end of execution of the task is cleared. Therefore, it is easy to identify a task whose flag is set due to runaway or the like. Can do. In addition, the cause of the failure can be easily pursued by saving the information on the task with the flag set.
以下、図面を参照して本発明の一実施形態によるCPU監視システム、装置、及び方法について詳細に説明する。図1は、本発明のCPU監視システムを備えるPHS基地局の要部構成を示すブロック図である。尚、本実施形態では、本発明のCPU監視システムをPHS基地局に適用する場合を例に挙げて説明するが、本発明のCPU監視システムはPHS基地局に設けられたCPUの監視を行う場合に制限されず、任意のCPUの監視に適用することが可能である。 Hereinafter, a CPU monitoring system, apparatus, and method according to an embodiment of the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram showing a main configuration of a PHS base station including a CPU monitoring system according to the present invention. In this embodiment, a case where the CPU monitoring system of the present invention is applied to a PHS base station will be described as an example. However, the CPU monitoring system of the present invention performs monitoring of a CPU provided in a PHS base station. However, the present invention can be applied to monitoring of any CPU.
図1に示す通り、PHS基地局10は、第1,第2送受信装置11,12、モデム部13、制御部14、及びDSU(Digital Service Unit)15を備えている。第1,第2送受信装置11,12は、PHS端末(通信端末装置)と無線通信を行う高周波回路(アンテナも含む)であって、PHS端末から受信した受信信号をモデム部13に出力すると共に、モデム部13から入力された送信信号をPHS端末に送信する。
As shown in FIG. 1, the
モデム部13は、上記受信信号の復号化又は送信信号の生成(符号化)を行うものであり、受信信号を復調して得られた信号(復号化音声信号や復号化画像信号)を制御部14に出力する。また、制御部14から出力された送信用の音声信号や画像信号を符号化して符号化音声信号や符号化画像信号を生成して第1送受信装置11又は第2送受信装置12に出力する。
The
制御部14は、CPU20、音声・画像変換部21、SDRAM(Synchronous DRAM(Dynamic Random Access Memory))22、SRAM(Static RandomAccess Memory)23、FlashROM(Flash Read Only Memory)24、BOOTROM(Boot Read Only Memory)25、FPGA(Field Programmable Gate Array)26、及びUSB部27を備えている。
The
図1に示す通り、制御部14は、CPU20、音声・画像変換部21、SDRAM22、SRAM23、FlashROM24、BOOTROM25、FPGA26、及びUSB部27がバスラインBによって接続されたものであり、SDRAM22に記憶された制御プログラムに基づいてモデム部13とDSU15との間でのデータの授受を制御する。
As shown in FIG. 1, the
CPU20は、タスク制御部20aとウォッチドッグタイマ(WDT)20bとを備えている。尚、ここでは説明の便宜上、CPU20がタスク制御部20aを備えているとして説明を進めるが、このタスク制御部20aは、CPU20がSDRAM22に記憶された制御プログラムを実行することでソフトウェア的に実現されるものであっても良い。タスク制御部20aは、CPU20で実行される各種タスクの実行を制御する。また、詳細は後述するが、本実施形態ではCPU20で割り込みルーチンが実行される。タスク制御部20aはこの割り込みルーチンの実行も制御する。
The
更に、タスク制御部20aはCPU20でタスクを実行させる場合には、実行開始時にフラグをセットし、実行終了時(タスクの一時的な停止時を含む)にセットしたフラグをクリアする制御を行う。この制御は、CPU20で実行されるタスク毎に行われる。つまり、タスク毎にそれぞれ異なるフラグが設定され、あるタスクの実行が開始された場合にはそのタスクのフラグがセットされ、そのタスクが終了して異なるタスクの実行が開始される場合には、終了されるタスクのフラグがクリアされるとともに、実行が開始されるタスクのフラグがセットされる。
Furthermore, when the task is executed by the
WDT20bは、計時のためのカウンタを備えており、カウンタがリセットされずにある値をカウントしきってしまうとCPU20をリセットする。このWDT20bはCPU20内に内蔵されている。尚、詳細は後述するが、WDT20bは、CPU20で実行される割り込みルーチンにより所定の時間間隔でリセットされる。
The
音声・画像変換部21は、CPU20による制御の下で、前述した復号化音声信号や復号化画像信号を回線網への送信に適した音声信号や画像信号に信号変換してCPU20に出力する。また、CPU20から入力された回線網からの音声信号や画像信号をPHS端末用の音声信号や画像信号に変換してモデム部13に出力する。
Under the control of the
SDRAM22は、CPU20が実行する制御プログラムを記憶する。また、SDRAM22には、記憶領域22a,22bが設けられている。記憶領域22aには、CPU20での割り込みルーチンの実行によりインクリメントされ、リセットタスク(詳細は後述する)の実行によりクリアされるカウント値が記憶される。尚、詳細は後述するが、この記憶領域22aはカウンタとして用いられる。また、記憶領域22bは、CPU20でのタスクの実行開始によりセットされ、実行終了によりクリアされるフラグが記憶される。
The
SRAM23は、CPU20の処理結果等を一時的に記憶するものである。FlashROM24は、例えばDSU15を介して上位制御系からダウンロードした展開前の制御プログラムを記憶するものである。BOOTROM25は、PHS基地局10の起動時にCPU20に実行されるブートプログラム(起動プログラム)を記憶するものである。FPGA26は、モデム部13やDSU15等のハードウェアを制御するために設けられたプログラマブルロジック回路である。USB部27は、メンテナンス用のコンピュータ等の外部装置とデータの授受を行うためのインタフェース回路である。
The
次に、以上説明したPHS基地局10に適用される本発明のCPU監視システムの動作について説明する。図2は、本発明の一実施形態によるCPU監視方法を示すタイミングチャートである。図2に示す通り、本実施形態においては、CPU20で割り込みルーチンRとリセットタスクTS3とが実行され、これらによりCPU20の実行状況を監視している。また、ここでは、CPU20にて、上記の割り込みルーチンRとリセットタスクTS3以外に、AタスクTS1及びBタスクTS2の2つのタスクが実行される場合を考える。
Next, the operation of the CPU monitoring system of the present invention applied to the
CPU20のタスク制御部20aは、図2に示す通り、AタスクTS1及びBタスクTS2並びにリセットタスクTS3の実行開始・終了を制御する。具体的に、タスク制御部20aは、タスクTS1,TS2及びリセットタスクTS3を時分割で実行させる。尚、これらのタスクのうち、AタスクTS1の優先度が最も高く、次にBタスクTS2の優先度が高いものとする。リセットタスクTS3は、CPU20で実行されるタスクのうち最も低い優先度に設定される。つまり、AタスクTS1及びBタスクTS2は、リセットタスクTS3よりも優先度が高いため、リセットタスクTS3に優先して実行される。また、割り込みルーチンRは、CPU20で実行されるタスクの優先度に拘わらず実行可能である。
The
タスク制御部20は、割り込みルーチンRを一定時間毎(例えば、100ミリ秒毎)に実行させるとともに、リセットタスクTS3を割り込みルーチンRの時間間隔よりも長い一定期間毎(例えば、3秒毎)に実行させる制御を行う。また、リセットタスクTS3以外のタスクを実行させる場合には、実行開始時にタスクの実行が開始された旨を示すフラグをSDRAM22の記憶領域22bに記憶することによりフラグをセットし、実行終了時にそのフラグをクリアする制御を行う。尚、このフラグはタスク毎に用意される。
The
割り込みルーチンRは、実行される度に、カウンタとして用いられるSDRAM22の記憶領域22aに記憶された値(カウント値)をインクリメントする処理を行うとともに、そのカウント値が予め設定された所定の閾値以内であるか否かを判断する。この閾値としては、例えば10秒の間に割り込みルーチンRが実行される回数に設定される。尚、以下の説明では、便宜的に、割り込みルーチンRが記憶領域22aに記憶されたカウント値をインクリメントする処理を「カウンタのインクリメント」という。
Each time the interrupt routine R is executed, the interrupt routine R performs a process of incrementing a value (count value) stored in the
また、割り込みルーチンRは、上記の判断により、記憶領域22aに記憶されたカウント値が所定の閾値以内である場合には、CPU20に設けられたWDT20bをクリアする処理を行う。これにより、カウント値が所定の閾値以内である場合には、WDT20bは、例えば100ミリ秒毎にクリアされることになる。これに対し、記憶領域22aに記憶されたカウント値が所定の閾値よりも大きい場合には、記憶領域22bにおいてフラグがセットされているタスクに関する情報を、例えばSDRAM22に待避する。
Further, the interrupt routine R performs a process of clearing the
いま、基地局10の電源投入等により動作が開始されたとすると、SDRAM22に記憶された制御プログラムが読み出されてCPU20で実行される。CPU20のタスク制御部20aは、CPU20の動作が開始されてから所定の時間(例えば、100ミリ秒)経過すると割り込みルーチンRを実行させる。割り込みルーチンRが実行されると、カウンタのインクリメントが行われるとともに(ステップS1)、このカウント値が閾値以内であるかが判断される(ステップS2)。
Now, assuming that the operation is started by turning on the power of the
ここで、初期状態においては、カウンタのカウント値が「0」に設定されているため、上記ステップS2における判断処理の判断結果は「YES」となる。これにより、割り込みルーチンRからWDT20bに対してリセット信号が出力され(ステップS3)、WDT20bがクリアされる(ステップS4)。
Here, in the initial state, since the count value of the counter is set to “0”, the determination result of the determination process in step S2 is “YES”. As a result, a reset signal is output from the interrupt routine R to the
次に、タスク制御部20aがAタスクTS1の実行を開始させたとする。AタスクTS1の実行を開始させるときに、タスク制御部20aは、AタスクTS1の実行が開始された旨を示すフラグをSDRAM22の記憶領域22bに記憶することによりAタスクTS1についてのフラグ(以下、Aフラグという)をセットする(ステップS5)。
Next, it is assumed that the
次いで、AタスクTS1が実行されている間に、BタスクTS2の実行開始要求があったとする。このとき、タスク制御部20aは、まずAタスクTS1を終了させるとともにAフラグをクリアする(ステップS6)。次いで、BタスクTS2の実行を開始させるとともに、BタスクTS2の実行が開始された旨を示すフラグをSDRAM22の記憶領域22bに記憶することによりBタスクTS2についてのフラグ(以下、Bフラグという)をセットする(ステップS5)。
Next, it is assumed that there is a request to start execution of the B task TS2 while the A task TS1 is being executed. At this time, the
次に、CPU20の動作が開始されてから所定の時間(例えば、3秒)が経過すると、タスク制御部20aは、リセットタスクTS3を実行させる。このとき、タスク制御部20aは、リセットタスクTS3の実行を開始する前に、BタスクTS2を終了させるとともにBフラグをクリアする(ステップS8)。リセットタスクTS3が実行されると、カウンタとして用いられるSDRAM22の記憶領域22aに記憶された値(カウント値)をクリアする処理が行われる(ステップS9)。かかる処理により、カウンタのカウント値が「0」に設定される。尚、以下の説明では、便宜的に、リセットタスクTS3が記憶領域22aに記憶されたカウント値をクリアする処理を「カウンタのクリア」という。
Next, when a predetermined time (for example, 3 seconds) elapses after the operation of the
リセットタスクTS3が終了した後で、AタスクTS1が実行されるとするとタスク制御部20aはAフラグをセットする(ステップS10)。以下同様に、CPU20で正常に複数のタスクが実行されている場合には、タスク制御部20bによりタスクの実行及び終了が制御されるとともに、タスクについてのフラグのセット及びクリアが行われる。また、一定の時間間隔(例えば、100ミリ秒)で割り込みルーチンRが実行されてカウンタのインクリメント及びWDT20bのクリアが行われるとともに、所定の時間間隔(例えば、3秒)でリセットタスクTS3が実行されてカウンタのクリアが行われる。
If the A task TS1 is executed after the reset task TS3 is completed, the
いま、BタスクTS2の実行が開始されてBフラグがセットされ(ステップS11)、その後にBタスクTS2が何らかの原因で暴走した場合を考える。BタスクTS2が暴走した場合であっても、割り込みルーチンRはCPU20で実行されるタスクの優先度に拘わらず実行可能である。従って、BタスクTS2が暴走した場合であっても、一定の時間間隔でカウンタのインクリメントが行われ、カウント値が閾値以内であれば、割り込みルーチンRからWDT20bに対してリセット信号が出力され(ステップS12)、WDT20bがクリアされる(ステップS13)。
Consider the case where the execution of the B task TS2 is started, the B flag is set (step S11), and then the B task TS2 runs away for some reason. Even when the B task TS2 runs away, the interrupt routine R can be executed regardless of the priority of the task executed by the
これに対し、リセットタスクTS3は、BタスクTS2よりも優先度が低いため、BタスクTS2が暴走してしまうと実行不可能になる。このため、BタスクTS2が暴走している間はカウンタのクリアは行われない。この結果として、割り込みルーチンRによるカウンタのインクリメントが継続されて、カウント値は次第に増加することになる。BタスクTS2が暴走してから所定時間経過した後(詳しくは、最後にリセットタスクTS3によりカウンタのクリアが行われてから20秒程度経過した後)に、割り込みルーチンRが実行されると、カウンタのインクリメントが行われるとともに(ステップS14)、このカウント値が閾値以内であるかが判断される(ステップS15)。ここで、カウント値が閾値を超えているとステップS15の判断結果は「NO」となる。 On the other hand, the reset task TS3 has a lower priority than the B task TS2, and therefore cannot be executed if the B task TS2 runs away. For this reason, the counter is not cleared while the B task TS2 runs out of control. As a result, the increment of the counter by the interrupt routine R is continued, and the count value gradually increases. When the interrupt routine R is executed after a predetermined time has elapsed since the B task TS2 has runaway (specifically, after about 20 seconds have elapsed since the counter was last cleared by the reset task TS3), the counter Is incremented (step S14), and it is determined whether the count value is within a threshold value (step S15). If the count value exceeds the threshold value, the determination result in step S15 is “NO”.
割り込みルーチンRで行われる判断処理の判断結果が「NO」になると、割り込みルーチンRは、まずSDRAM22の記憶領域22bにおいて、セットされているフラグ(クリアされていないフラグ)を検索し、クリアされていないフラグがある場合には、このフラグについてのタスクに関する情報をSDRAM22に待避する(ステップS16)。図2に示す例では、ステップS11でBフラグがセットされており、クリアが行われていないため、BタスクTS2に関する情報がSDRAM22に待避される。
When the determination result of the determination process performed in the interrupt routine R is “NO”, the interrupt routine R first searches the
また、ステップS15の判断結果が「NO」である場合には、割り込みルーチンRからWDT20bにリセット信号が送信されない。このため、WDT20bがクリアされず、WDT20bでのカウントが継続されることになる。そして、WDT20bがクリアされなくなってから所定の時間が経過すると、WDT20bはタイムアウトとなり、CPU20がリセットされる。
If the determination result in step S15 is “NO”, no reset signal is transmitted from the interrupt routine R to the
以上説明した通り、本実施形態では、割り込みルーチンRを一定の時間間隔で実行させてカウンタのインクリメントを行うとともに、割り込みルーチンRが実行される時間間隔よりも長い時間間隔でリセットタスクTS3を実行させてカウンタのクリアを行っている。ここで、割り込みルーチンRはCPU20で行われるタスクの優先度に拘わらず実行可能であるが、リセットタスクTS3はCPU20で実行されるタスクのうちの最も低い優先度に設定されているため、タスクが暴走してしまうと実行不可能になる。カウンタのカウント値が所定の閾値以内であれば、WDT20bは割り込みルーチンRによりクリアされるが、カウンタのカウント値が所定の閾値よりも大きいとWDT20bはクリアされなくなってWDT20bによりCPU20がリセットされる。以上により、図3に示す外付けWDT101が無くとも、CPU20の実行状況を監視することができ、回路の簡略化及びコスト削減を図ることができる。
As described above, in this embodiment, the interrupt routine R is executed at regular time intervals to increment the counter, and the reset task TS3 is executed at a time interval longer than the time interval at which the interrupt routine R is executed. The counter is cleared. Here, the interrupt routine R can be executed regardless of the priority of the task executed by the
また、本実施形態では、リセットタスクTS3以外のタスクを実行させる場合には、実行開始時にフラグをセットし、実行終了時にセットしたフラグをクリアしている。そして、カウンタのカウント値が所定の閾値よりも大きい場合には、割り込みルーチンRによって、フラグがセットされたままである(フラグがクリアされていない)タスクに関する情報を待避している。このため、暴走等の障害が発生したタスクを容易に特定することができ、これにより、容易に障害の発生原因を追求することができる。 In the present embodiment, when a task other than the reset task TS3 is executed, a flag is set at the start of execution, and the flag set at the end of execution is cleared. When the count value of the counter is larger than a predetermined threshold value, the interrupt routine R saves information related to the task for which the flag remains set (the flag is not cleared). For this reason, it is possible to easily identify a task in which a failure such as a runaway has occurred, thereby easily pursuing the cause of the failure.
以上、本発明の一実施形態によるCPU監視システム、装置、及び方法について説明したが、本発明は上記実施形態に制限されることなく、本発明の範囲内で自由に変更が可能である。例えば、以上説明した実施形態では、SDRAM22の記憶領域22aにカウント値を記憶させ、割り込みルーチンRがカウント値をインクリメントする場合を例に挙げて説明したが、割り込みルーチンRの指示に従ってインクリメントを行うカウンタを設けた構成であっても良い。
Although the CPU monitoring system, apparatus, and method according to the embodiment of the present invention have been described above, the present invention is not limited to the above-described embodiment, and can be freely changed within the scope of the present invention. For example, in the embodiment described above, the case where the count value is stored in the
20 CPU
20a タスク制御部
20b ウォッチドッグタイマ
22a,22b 記憶領域
R 割り込みルーチン
TS3 リセットタスク
20 CPU
20a
Claims (12)
カウントを行うカウント手段と、
第1の所定時間毎に、前記カウント手段にカウントさせるとともに前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込み手段と、
前記第1の所定期間よりも長い第2の所定時間毎に、前記カウント手段のカウント値をクリアするリセット手段と
を備えることを特徴とするCPU監視システム。 In a CPU monitoring system for monitoring the execution status of a CPU having a watchdog timer,
A counting means for counting,
Interrupt means for causing the counting means to count at each first predetermined time and clearing the watchdog timer when the count value of the counting means is within a predetermined value;
A CPU monitoring system comprising: a reset unit that clears a count value of the count unit every second predetermined time longer than the first predetermined period.
カウントを行うカウント手段と、
前記カウント手段にカウントさせ、前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込みルーチンを第1の所定時間毎に実行させるとともに、前記カウント手段のカウント値をクリアするリセットタスクを前記第1の所定期間よりも長い第2の所定時間毎に実行させるタスク制御手段と
を備えることを特徴とするCPU監視システム。 In a CPU monitoring system for monitoring the execution status of a CPU having a watchdog timer,
A counting means for counting,
When the count value of the count means is within a predetermined value, an interrupt routine for clearing the watchdog timer is executed every first predetermined time, and the count value of the count means is set. And a task control unit that executes a reset task to be cleared every second predetermined time longer than the first predetermined period.
前記リセットタスクは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されている
ことを特徴とする請求項2記載のCPU監視システム。 The interrupt routine can be executed regardless of the priority of the task executed by the CPU,
The CPU monitoring system according to claim 2, wherein the reset task has a lowest priority among tasks executed by the CPU.
カウントを行うカウント手段と、
第1の所定時間毎に、前記カウント手段にカウントさせるとともに前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込み手段と、
前記第1の所定期間よりも長い第2の所定時間毎に、前記カウント手段のカウント値をクリアするリセット手段と
を備えることを特徴とするCPU監視装置。 In a CPU monitoring device that monitors the execution status of a CPU having a watchdog timer,
A counting means for counting,
Interrupt means for causing the counting means to count at each first predetermined time and clearing the watchdog timer when the count value of the counting means is within a predetermined value;
A CPU monitoring device comprising: a reset unit that clears a count value of the count unit every second predetermined time longer than the first predetermined period.
カウントを行うカウント手段と、
前記カウント手段にカウントさせ、前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする割り込みルーチンを第1の所定時間毎に実行させるとともに、前記カウント手段のカウント値をクリアするリセットタスクを前記第1の所定期間よりも長い第2の所定時間毎に実行させるタスク制御手段と
を備えることを特徴とするCPU監視装置。 In a CPU monitoring device that monitors the execution status of a CPU having a watchdog timer,
A counting means for counting,
When the count value of the count means is within a predetermined value, an interrupt routine for clearing the watchdog timer is executed every first predetermined time, and the count value of the count means is set. A CPU monitoring device comprising: task control means for executing a reset task to be cleared every second predetermined time longer than the first predetermined period.
前記リセットタスクは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されている
ことを特徴とする請求項7記載のCPU監視装置。 The interrupt routine can be executed regardless of the priority of the task executed by the CPU,
The CPU monitoring device according to claim 7, wherein the reset task has a lowest priority among tasks executed by the CPU.
第1の所定時間毎にカウント手段によりカウントを行う第1ステップと、
前記第1の所定期間よりも長い第2の所定時間毎に前記カウント手段のカウント値をクリアする第2ステップと、
前記カウント手段のカウント値が所定値以内である場合には前記ウォッチドッグタイマをクリアする第3ステップと
を含むことを特徴とするCPU監視方法。 In a CPU monitoring method for monitoring the execution status of a CPU having a watchdog timer,
A first step of counting by a counting means every first predetermined time;
A second step of clearing the count value of the counting means every second predetermined time longer than the first predetermined period;
And a third step of clearing the watchdog timer when the count value of the counting means is within a predetermined value.
前記第2ステップは、前記CPUで実行されるタスクのうちで最も低い優先度が設定されて実行される
ことを特徴とする請求項9記載のCPU監視方法。 The first step is executed regardless of the priority of the task executed by the CPU,
The CPU monitoring method according to claim 9, wherein the second step is executed by setting a lowest priority among tasks executed by the CPU.
前記タスクの実行終了時にセットしたフラグをクリアするステップと
を含むことを特徴とする請求項9又は請求項10記載のCPU監視方法。 Setting a flag at the start of execution when the CPU executes a task;
The CPU monitoring method according to claim 9, further comprising: clearing a flag set at the end of execution of the task.
12. The method according to claim 9, further comprising a fourth step of saving information related to a task for which the flag is set when the count value of the counting means is larger than the predetermined value. The CPU monitoring method according to any one of the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006086785A JP2007264856A (en) | 2006-03-28 | 2006-03-28 | Cpu monitoring system, device and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006086785A JP2007264856A (en) | 2006-03-28 | 2006-03-28 | Cpu monitoring system, device and method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007264856A true JP2007264856A (en) | 2007-10-11 |
Family
ID=38637808
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006086785A Pending JP2007264856A (en) | 2006-03-28 | 2006-03-28 | Cpu monitoring system, device and method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007264856A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012230637A (en) * | 2011-04-27 | 2012-11-22 | Denso Corp | Program group |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63280345A (en) * | 1987-05-13 | 1988-11-17 | Fujitsu Ltd | Detection of program abnormality |
JPH02207347A (en) * | 1989-02-08 | 1990-08-17 | Toshiba Corp | Method for detecting fault of software |
JPH02304640A (en) * | 1989-05-19 | 1990-12-18 | Nec Corp | Memory dump collecting system |
JPH07114490A (en) * | 1993-10-19 | 1995-05-02 | Matsushita Electric Ind Co Ltd | Runaway monitoring device |
JP2003196119A (en) * | 2001-12-27 | 2003-07-11 | Murata Mach Ltd | Communication device |
-
2006
- 2006-03-28 JP JP2006086785A patent/JP2007264856A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63280345A (en) * | 1987-05-13 | 1988-11-17 | Fujitsu Ltd | Detection of program abnormality |
JPH02207347A (en) * | 1989-02-08 | 1990-08-17 | Toshiba Corp | Method for detecting fault of software |
JPH02304640A (en) * | 1989-05-19 | 1990-12-18 | Nec Corp | Memory dump collecting system |
JPH07114490A (en) * | 1993-10-19 | 1995-05-02 | Matsushita Electric Ind Co Ltd | Runaway monitoring device |
JP2003196119A (en) * | 2001-12-27 | 2003-07-11 | Murata Mach Ltd | Communication device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012230637A (en) * | 2011-04-27 | 2012-11-22 | Denso Corp | Program group |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8032679B2 (en) | Device and method for controlling network processing mode, and non-transitory computer-readable medium recording program for controlling network processing mode | |
JP5099090B2 (en) | Multi-core system, multi-core system control method, and multi-processor | |
JP2007109238A (en) | System and method for logging recoverable error | |
US9164823B2 (en) | Resetting a peripheral driver and prohibiting writing into a register retaining data to be written into a peripheral on exceeding a predetermined time period | |
JP2009110156A (en) | Log output device and log output program | |
JP4955585B2 (en) | Computer system, information processing method and program | |
US9436627B2 (en) | Detection of abnormal operation caused by interrupt processing | |
JP2007264856A (en) | Cpu monitoring system, device and method | |
JP4675293B2 (en) | Interrupt control circuit | |
JP2008225807A (en) | Control device, and program runaway monitoring method for the same | |
JP2010128790A (en) | Semiconductor device and its abnormality detecting method | |
JP2006011686A (en) | Method for detecting abnormality of multi-task system | |
JP2010009258A (en) | Fault detection device of software | |
JP2009151440A (en) | Program hang-up detection method and computer device adopting the same method | |
JP6731179B2 (en) | Control arithmetic unit | |
JP6049961B1 (en) | CPU monitoring device | |
JP4567586B2 (en) | Processing equipment | |
JP6004743B2 (en) | COMMUNICATION DEVICE AND ITS CONTROL METHOD | |
JP2010258814A (en) | Communication device | |
JP6859677B2 (en) | Terminal equipment | |
JP2007122490A (en) | Computer | |
CN115016977A (en) | Hierarchical reset control method and system for heterogeneous multi-core power chip | |
JP5338356B2 (en) | COMMUNICATION DEVICE, COMMUNICATION SYSTEM, POWER CONTROL METHOD, AND PROGRAM | |
JP2006163730A (en) | Interrupt control method and controller using it | |
WO2017037863A1 (en) | Computer device, control method, and control program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080902 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100702 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101005 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20110308 |