Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3137025B2 - Runaway detection method for data processing system - Google Patents
[go: Go Back, main page]

JP3137025B2 - Runaway detection method for data processing system - Google Patents

Runaway detection method for data processing system

Info

Publication number
JP3137025B2
JP3137025B2 JP09079953A JP7995397A JP3137025B2 JP 3137025 B2 JP3137025 B2 JP 3137025B2 JP 09079953 A JP09079953 A JP 09079953A JP 7995397 A JP7995397 A JP 7995397A JP 3137025 B2 JP3137025 B2 JP 3137025B2
Authority
JP
Japan
Prior art keywords
processing
watchdog timer
interrupt
reset
program
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.)
Expired - Fee Related
Application number
JP09079953A
Other languages
Japanese (ja)
Other versions
JPH10275097A (en
Inventor
幸生 小池
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP09079953A priority Critical patent/JP3137025B2/en
Publication of JPH10275097A publication Critical patent/JPH10275097A/en
Application granted granted Critical
Publication of JP3137025B2 publication Critical patent/JP3137025B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はデータ処理システム
の暴走検出方法に係り、特にコンピュータを用いたデー
タ処理システムの暴走検出方法に関する。
The present invention relates to a runaway detection method for a data processing system, and more particularly to a runaway detection method for a data processing system using a computer.

【0002】[0002]

【従来の技術】コンピュータを用いたデータ処理システ
ムにおける暴走検出方法の一つとして、従来よりウォッ
チドッグ・タイマを用いる方法が知られている(特開昭
62−175840号公報)。図7はこの従来のデータ
処理システムの暴走検出方法の一例の構成図を示す。ま
た、図8は、図7中の手段701で処理される処理プロ
グラム750のより詳細に記述した例を示す。
2. Description of the Related Art As one of methods for detecting runaway in a data processing system using a computer, a method using a watchdog timer has been conventionally known (Japanese Patent Application Laid-Open No. Sho 62-175840). FIG. 7 is a block diagram showing an example of a runaway detection method of the conventional data processing system. FIG. 8 shows an example in which the processing program 750 processed by the means 701 in FIG. 7 is described in more detail.

【0003】図7において、暴走検出方法は、所定の処
理プログラム750及びそれを処理する処理手段701
と、処理手段701による処理プログラム750の稼働
中でリセットされるウォッチドッグ・タイマ711と、
ウォッチドッグ・タイマ711のオーバーフローにより
発生される暴走検出信号721より構成されている。
Referring to FIG. 7, a runaway detection method includes a predetermined processing program 750 and a processing means 701 for processing the same.
A watchdog timer 711 that is reset while the processing program 750 is running by the processing unit 701;
It comprises a runaway detection signal 721 generated by an overflow of the watchdog timer 711.

【0004】処理プログラム750は、図8に751で
示す処理プログラムに相当し、初期処理(ステップ80
1)、第1の処理(ステップ802)を順次に実行した
後ウォッチドッグタイマをリセットし(ステップ80
3)、第2の処理をn回ループした後(ステップ80
4)、ウォッチドッグタイマをリセットし(ステップ8
05)、再びステップ802に戻って第1の処理を実行
することを繰り返す。なお、ステップ803とステップ
805は同一のウォッチドッグタイマのリセットであ
り、以下の説明を進める上で便宜上異なるステップで示
してある。
The processing program 750 corresponds to a processing program indicated by reference numeral 751 in FIG.
1) After the first processing (step 802) is sequentially executed, the watchdog timer is reset (step 80).
3) After the second process is looped n times (step 80)
4) and reset the watchdog timer (step 8)
05), returning to step 802 again and executing the first process are repeated. Steps 803 and 805 are resets of the same watchdog timer, and are shown in different steps for the sake of convenience in the following description.

【0005】図7において、ウォッチドッグタイマ71
1がオーバーフローするまでの時間をT、図8のステッ
プ802における第1の処理の処理時間をTa、ステッ
プ804の第2の処理の処理時間をTbとすると、Ta
<T、かつ、n×Tb<Tとなるように、ステップ80
2及び804のウォッチドッグタイマリセットの位置が
設定される。
In FIG. 7, a watch dog timer 71
Assuming that T is the time until 1 overflows, Ta is the processing time of the first processing in step 802 in FIG. 8, and Tb is the processing time of the second processing in step 804 in FIG.
Step 80 so that <T and n × Tb <T
Watchdog timer reset positions 2 and 804 are set.

【0006】このように、ウォッチドッグタイマリセッ
トが設定された処理手段701においては、正常動作時
はウォッチドッグタイマ711にオーバーフローが発生
することはなく、従って暴走検出信号721も発生しな
い。
As described above, in the processing means 701 in which the watchdog timer reset is set, the overflow of the watchdog timer 711 does not occur during the normal operation, and the runaway detection signal 721 does not occur.

【0007】一方、処理手段701において暴走の発生
により、第1の処理及び第2の処理のいずれかが途中で
停止してしまったり、第2の処理の処理回数がn回を越
えて異常に長くなってしまうような予期しない長い処理
時間が発生し、ウォッチドッグタイマ711のリセット
が時間Tを越えて行われないと、ウォッチドッグタイマ
711がオーバーフローし、暴走検出信号721が発生
する。以上の図7の従来の構成により、暴走検出ができ
る。
On the other hand, when a runaway occurs in the processing means 701, one of the first processing and the second processing is stopped halfway, or the number of times of the second processing exceeds n times and becomes abnormal. If the watchdog timer 711 is not reset beyond the time T when an unexpectedly long processing time such as a long processing time occurs, the watchdog timer 711 overflows and the runaway detection signal 721 is generated. With the above-described conventional configuration of FIG. 7, runaway detection can be performed.

【0008】ところで、今日のデータ処理システムにお
いては、サブルーチンや割り込み処理の使用による処理
の多重化、並びに処理項目を一つの固まりとし、極力、
他の処理プログラムと分離するプログラムのモジュール
化が一般的になっている。これらは、優先順位の高い処
理を設けることで処理の即時性を向上するためや、プロ
グラムの再利用性、開発効率化を進めるために用いられ
る一般的な方法であるが、近年、プログラムサイズは増
加の一途を辿っており、小型のマイクロコンピュータに
おいてさえ、全体で数万ステップものプログラムサイズ
を持つものが珍しくない。このため、長大なプログラム
中での即時性の確保、並びにプログラムの開発効率化の
ためには、これらの手法は必須となりつつある。
By the way, in today's data processing systems, processing is multiplexed by using subroutines and interrupt processing, and processing items are grouped into one.
It is common to modularize programs that are separate from other processing programs. These are general methods used to improve the immediacy of processing by providing high-priority processing, and to promote program reusability and development efficiency. With ever-increasing numbers, it is not uncommon for even a small microcomputer to have a program size of tens of thousands of steps in total. For this reason, these methods are becoming indispensable in order to secure immediacy in a long program and to improve the efficiency of program development.

【0009】しかしながら、このような多重化、プログ
ラムのモジュール化を行った場合にウォッチドッグタイ
マのリセットをどの程度の頻度でどのようにプログラム
中に入れるかということは、非常に難しい問題であり、
プログラムのモジュール化を進める上で大きな問題とな
っている。
However, when such multiplexing and program modularization are performed, it is very difficult to determine how often and how often the reset of the watchdog timer is inserted into the program.
This is a major problem in modularizing programs.

【0010】図9は図7の従来方法の処理手段701で
処理される処理プログラム750の詳細の異なる例を示
したものである。図9において、図8と同一処理は同一
符号を付してある。図9に示す処理プログラム752
は、前記図7の処理プログラム750に相当し、初期処
理(ステップ801)、第1の処理(ステップ802)
を順次に実行した後ウォッチドッグタイマをリセットし
(ステップ803)、第2の処理をn回ループした後
(ステップ804)、ウォッチドッグタイマをリセット
し(ステップ805)、再びステップ802に戻って第
1の処理を実行することを繰り返す。
FIG. 9 shows a different example of the details of the processing program 750 processed by the processing means 701 of the conventional method of FIG. 9, the same processes as those in FIG. 8 are denoted by the same reference numerals. Processing program 752 shown in FIG.
Corresponds to the processing program 750 in FIG. 7, and includes an initial process (step 801), a first process (step 802)
Are sequentially executed, the watchdog timer is reset (step 803), the second process is looped n times (step 804), and then the watchdog timer is reset (step 805). Execution of the process 1 is repeated.

【0011】以上は図8の処理プログラム751と同様
であるが、この処理プログラム752では更に第1の処
理の処理期間中に、割り込み処理I1を処理し(ステッ
プ806)、第2の処理の処理期間中に割り込み処理I
2を処理する(ステップ807)。割り込み処理I1及
びI2は即時性が要求される処理であり、定期的に発生
する処理である。図8の処理プログラム751と図9の
処理プログラム752との相違点は、図9の処理プログ
ラム752においては、これらの割り込み処理による多
重化が考慮されていることにある。
The above is the same as the processing program 751 in FIG. 8, but the processing program 752 further processes the interrupt processing I1 during the processing of the first processing (step 806), and executes the processing of the second processing. Interrupt processing I during the period
2 is processed (step 807). The interrupt processes I1 and I2 are processes that require immediacy and are processes that occur periodically. The difference between the processing program 751 in FIG. 8 and the processing program 752 in FIG. 9 is that the processing program 752 in FIG. 9 considers multiplexing by these interrupt processes.

【0012】図7において、ウォッチドッグタイマ71
1がオーバーフローするまでの時間をT、図9における
第1の処理の処理時間をTa、割り込み処理I1の処理
時間をTi1、第2の処理の処理時間をTb、割り込み
処理I2の処理時間をTi2とすると、Ta+Ti1<
T かつ n×(Tb+Ti2)<Tとなるよう
に、ステップ803のウォッチドッグタイマのリセット
位置と、ステップ805のウォッチドッグタイマのリセ
ット位置とが設定される。
In FIG. 7, a watch dog timer 71
T is the time until 1 overflows, Ta is the processing time of the first processing in FIG. 9, Ti1 is the processing time of the interrupt processing I1, Tb is the processing time of the second processing, and Ti2 is the processing time of the interrupt processing I2. Then, Ta + Ti1 <
The reset position of the watchdog timer in step 803 and the reset position of the watchdog timer in step 805 are set so that T and n × (Tb + Ti2) <T.

【0013】図9の例でも図8の例と同様に暴走が検出
される。しかしながら、割り込み処理I1並びにI2が
不定期に発生する場合には、図9のような処理プログラ
ム752の構成は使用できない。これは、例えばステッ
プ802の第1の処理の期間中に複数の割り込み処理I
1やI2が発生すると、ウォッチドッグタイマのリセッ
トの間隔が、 Ta+n1×Ti1+n2×Ti2>T (n1は割り込み処理I1の発生回数、n2は割り込み
処理I2の発生回数)となり、処理は正常に行われてい
るにもかかわらず、これらの割り込み処理期間中にウォ
ッチドッグタイマ711がオーバーフローしてしまう可
能性があるからである。
In the example of FIG. 9, runaway is detected as in the example of FIG. However, when the interrupt processes I1 and I2 occur irregularly, the configuration of the processing program 752 as shown in FIG. 9 cannot be used. This is because, for example, a plurality of interrupt processing I
When 1 or I2 occurs, the reset interval of the watchdog timer becomes Ta + n1 × Ti1 + n2 × Ti2> T (n1 is the number of times interrupt processing I1 has occurred, n2 is the number of times interrupt processing I2 has occurred), and processing is performed normally. This is because the watchdog timer 711 may overflow during these interrupt processing periods.

【0014】ウォッチドッグタイマのオーバーフロー時
間T及びステップ803及び805のウォッチドッグタ
イマのリセットの位置は、このような可能性も考慮して
設定されるべきであるが、今日のデータ処理システム、
特にマイクロコンピュータにおいては、周辺機能が多数
付いており、割り込み要因も10を越えることが少なく
なく、また、その処理時間も数十マイクロ秒から数ミリ
秒と多岐にわたっており、このようなオーバーフローの
可能性を排除した時間Tやウォッチドッグタイマのリセ
ットの設定は極めて困難である。
The overflow time T of the watchdog timer and the reset position of the watchdog timer in steps 803 and 805 should be set in consideration of such a possibility.
In particular, microcomputers have many peripheral functions, interrupt factors often exceed 10, and the processing time varies widely from tens of microseconds to several milliseconds. It is extremely difficult to set the time T and the reset of the watchdog timer while eliminating the characteristics.

【0015】また、割り込み処理I1及びI2が定期的
に発生する場合でも、これらの処理の処理時間がプログ
ラムの修正などにより延びたりすると、ステップ803
及び805のウォッチドッグタイマのリセットの位置を
Ta+Ti1<T かつ n×(Tb+Ti2)<
Tを満足するように修正する必要があるため、プログラ
ムのモジュール化が困難であった。
Even if the interrupt processes I1 and I2 are periodically generated, if the processing time of these processes is extended due to a program modification or the like, step 803 is executed.
And 805, the reset position of the watchdog timer is set to Ta + Ti1 <T and nx (Tb + Ti2) <
Since it is necessary to modify T to satisfy T, it has been difficult to modularize the program.

【0016】図10は図7の従来の構成を用いた場合の
処理手段701で処理される処理プログラム750の第
3の例を示す。図10中、図9と同一処理には同一符号
を付してある。図10に示す処理プログラム753は、
前記図7の処理プログラム750に相当し、初期処理
(ステップ801)、第1の処理(ステップ802)を
順次に実行した後ウォッチドッグタイマをリセットし
(ステップ803)、第2の処理をn回ループした後
(ステップ804)、ウォッチドッグタイマをリセット
し(ステップ805)、再びステップ802に戻って第
1の処理を実行することを繰り返す。
FIG. 10 shows a third example of the processing program 750 processed by the processing means 701 when the conventional configuration of FIG. 7 is used. 10, the same processes as those in FIG. 9 are denoted by the same reference numerals. The processing program 753 shown in FIG.
7 corresponds to the processing program 750 of FIG. 7 described above. After the initial processing (step 801) and the first processing (step 802) are sequentially executed, the watchdog timer is reset (step 803), and the second processing is performed n times. After the loop (step 804), the watchdog timer is reset (step 805), and the process returns to step 802 again to execute the first process.

【0017】以上は図8の処理プログラム751と同様
であるが、この処理プログラム753では更に第1の処
理の処理期間中に、ウォッチドッグタイマをリセットし
た後(ステップ808)、割り込み処理I1を実行し
(ステップ809)、また、第2の処理の処理期間中
に、ウォッチドッグタイマをリセットした後(ステップ
810)、割り込み処理I2を処理する(ステップ81
1)。割り込み処理I1及びI2は即時性が要求される
処理であり、定期的に発生する処理である。
The above is the same as the processing program 751 in FIG. 8, but the processing program 753 further executes the interrupt processing I1 after resetting the watchdog timer during the processing of the first processing (step 808). Then, after resetting the watchdog timer during the processing period of the second processing (step 809), the interrupt processing I2 is processed (step 81).
1). The interrupt processes I1 and I2 are processes that require immediacy and are processes that occur periodically.

【0018】図7において、ウォッチドッグタイマ71
1がオーバーフローするまでの時間をT、図10におけ
る第1の処理の処理時間をTa、割り込み処理I1の処
理時間をTi1、第2の処理の処理時間をTb、割り込
み処理I2の処理時間をTi2とすると、Ta+Ti1
<T かつ n×(Tb+Ti2)<Tとなるよう
に、ステップ803のウォッチドッグタイマのリセット
位置と、ステップ805のウォッチドッグタイマのリセ
ット位置とが設定される。
In FIG. 7, a watch dog timer 71
10, T is the processing time of the first processing in FIG. 10, T1 is the processing time of the interrupt processing I1, Tb is the processing time of the second processing, and Ti2 is the processing time of the second processing in FIG. Then, Ta + Ti1
The reset position of the watchdog timer in step 803 and the reset position of the watchdog timer in step 805 are set so that <T and n × (Tb + Ti2) <T.

【0019】図10の例でも図8及び図9の例と同様に
暴走が検出される。また、この図10の例では割り込み
処理I1、I2中の先頭においても、ステップ808、
810でウォッチドッグタイマのリセットを行うこと
で、図9の処理プログラム752において問題となって
いた割り込み処理が複数発生したときに、ウォッチドッ
グタイマ711がオーバーフローするという問題を解決
できるよう構成されている。
In the example of FIG. 10, runaway is detected as in the examples of FIGS. Further, in the example of FIG. 10, even at the head of the interrupt processing I1 and I2, step 808,
By resetting the watchdog timer at 810, it is possible to solve the problem that the watchdog timer 711 overflows when a plurality of interrupt processes, which have been a problem in the processing program 752 of FIG. 9, occur. .

【0020】しかしながら、図7の処理プログラム75
0を図10に示した処理プログラム753の構成とした
場合、第2の処理のn回のループにおいてループ回数の
暴走が発生しても、ウォッチドッグタイマ711は、割
り込み処理I2中で毎回リセットされるため、そのよう
な暴走が検出できないという新しい問題が発生する。
However, the processing program 75 shown in FIG.
If the processing program 753 shown in FIG. 10 is set to 0, the watchdog timer 711 is reset every time during the interrupt processing I2 even if the runaway of the number of loops occurs in n loops of the second processing. Therefore, a new problem that such runaway cannot be detected occurs.

【0021】一方、図7の従来方法とは異なる構成を有
する、多重処理に注目した暴走検出方法として、特開昭
62−175840号公報記載のものが知られている。
図11はこの公報記載の従来の暴走検出方法の一例の概
念図を示す。図11において、マルチレベル構造の処理
プログラム901は、最高レベルの処理プログラムA、
次レベルの処理プログラムB及び最低レベルの処理プロ
グラムCとこれら各処理プログラムA、B及びCの実行
後に実行されるリセットプログラムa、b及びcから構
成されている。更に、この従来方法においては、最高レ
ベルの処理プログラムAを所定周期で起動するタイマ9
02、リセットプログラムa、b及びcによってリセッ
トされるウォッチドッグタイマ903a、903b及び
903c、オアゲート904及び障害発生検出回路90
5を用いる。
On the other hand, as a runaway detection method having a configuration different from that of the conventional method shown in FIG. 7 and focusing on multiplex processing, a method disclosed in Japanese Patent Application Laid-Open No. Sho 62-175840 is known.
FIG. 11 shows a conceptual diagram of an example of a conventional runaway detection method described in this publication. In FIG. 11, a processing program 901 having a multi-level structure includes a processing program A having the highest level,
It comprises a next-level processing program B, a lowest-level processing program C, and reset programs a, b, and c that are executed after the execution of each of these processing programs A, B, and C. Further, in this conventional method, the timer 9 which starts the highest level processing program A at a predetermined cycle is used.
02, watchdog timers 903a, 903b and 903c reset by reset programs a, b and c, OR gate 904 and fault occurrence detection circuit 90
5 is used.

【0022】タイマ902は常に所定周期Tで最高レベ
ルの処理プログラムAを起動する。処理プログラムAが
終了すると、リセットプログラムaによりウォッチドッ
グタイマ903aがリセットされた後、次レベルの処理
プログラムBの実行が開始される。処理プログラムBの
実行が終了すると、リセットプログラムbによりウォッ
チドッグタイマ903bがリセットされた後最低レベル
の処理プログラムCの実行が開始される。処理プログラ
ムCが終了すると、リセットプログラムcによりウォッ
チドッグタイマ903cがリセットされた後処理装置は
アイドル状態に移行する。この後、タイマ902からの
周期Tの信号により再度、処理プログラムAからの処理
を繰り返す。
The timer 902 always starts the highest level processing program A at a predetermined period T. When the processing program A ends, the reset program a resets the watchdog timer 903a, and then the execution of the next level processing program B is started. When the execution of the processing program B is completed, the execution of the processing program C of the lowest level is started after the reset program b resets the watchdog timer 903b. When the processing program C ends, the watchdog timer 903c is reset by the reset program c, and the processing device shifts to an idle state. Thereafter, the processing from the processing program A is repeated again by the signal of the cycle T from the timer 902.

【0023】負荷変動により処理プログラムB、Cの終
了がタイマ902からの処理プログラムAの再起動に間
に合わなかった場合は、その時点でプログラムB、Cの
処理を中断して状態を退避し、上位レベルのプログラム
の処理を行った後、退避時のレベルに再度達した時点
で、以前の処理を再開するよう構成されている。
If the end of the processing programs B and C cannot be completed in time for the restart of the processing program A from the timer 902 due to the load fluctuation, the processing of the programs B and C is interrupted at that time and the state is saved. After the processing of the level program is performed, when the level at the time of evacuation is reached again, the previous processing is restarted.

【0024】この公報記載の従来方法によれば、ウォッ
チドッグタイマ903aのオーバーフローするまでの時
間の設定は、ウォッチドッグタイマ903aをリセット
する処理プログラムAが周期Tで常に起動されることか
ら負荷変動に基づく実行時間のばらつきを考慮して例え
ば1.5T程度の値に設定されるとされている。また、
ウォッチドッグタイマ903b及び903cのオーバー
フローするまでの時間は、処理プログラムBとCのレベ
ルと負荷変動に基づくリセット間隔のばらつきを考慮し
て、例えばそれぞれ3T、6T程度の値に設定されると
されている。
According to the conventional method described in this publication, the setting of the time until the watchdog timer 903a overflows is performed in accordance with the load fluctuation because the processing program A for resetting the watchdog timer 903a is always started in the cycle T. It is set to a value of, for example, about 1.5T in consideration of the variation in the execution time based on the execution time. Also,
The time until the watchdog timers 903b and 903c overflow is set to, for example, about 3T and 6T, respectively, in consideration of the variation of the reset intervals based on the levels of the processing programs B and C and the load fluctuation. I have.

【0025】ウォッチドッグタイマ903a〜903c
のいずれかにオーバーフローが発生すると、オアゲート
904を経て障害発生検出回路905に通知され、障害
発生検出信号が出力され、警報の発生や予備装置への切
り換えが行われる。
Watchdog timers 903a to 903c
When an overflow occurs in any of the above, a fault occurrence detection circuit 905 is notified via an OR gate 904, a fault occurrence detection signal is output, and an alarm is generated and switching to a standby device is performed.

【0026】[0026]

【発明が解決しようとする課題】しかるに、上記の図7
〜図10と共に説明した従来の暴走検出方法では、プロ
グラムの多重化に対応することが非常に困難である。ま
た、図11に示した従来の暴走検出方法では、どの程度
の負荷変動が発生するかを適切に見込むことは図7と図
9の従来方法の説明にて前述した通り非常に難しい。
However, FIG.
In the conventional runaway detection method described with reference to FIG. 10, it is very difficult to cope with program multiplexing. Also, in the conventional runaway detection method shown in FIG. 11, it is very difficult to properly estimate how much load variation will occur, as described above with reference to FIGS. 7 and 9.

【0027】また、図7〜図10と共に説明した従来の
暴走検出方法では、プログラムのモジュール化が困難で
ある。図11に示した従来の暴走検出方法でも、プログ
ラムの修正などにより上位レベルの処理プログラムの処
理時間が延びた場合、下位レベルの処理プログラムのウ
ォッチドッグタイマのリセット位置がずれるため、下位
レベルの処理プログラムも同時に修正するか、下位レベ
ルの処理プログラムに対応したウォッチドッグタイマの
オーバーフロー時間を修正せねばならず、プログラムを
モジュール化することが困難である。
In the conventional runaway detection method described with reference to FIGS. 7 to 10, it is difficult to modularize a program. Even in the conventional runaway detection method shown in FIG. 11, if the processing time of the upper-level processing program is extended due to a program modification or the like, the reset position of the watchdog timer of the lower-level processing program is shifted, so that the lower-level processing is performed. It is necessary to correct the program at the same time or to correct the overflow time of the watchdog timer corresponding to the lower-level processing program, and it is difficult to modularize the program.

【0028】これらの従来方法の問題点の理由は、いず
れも処理するプログラムが時分割で多重化されているに
もかかわらず、各処理プログラムに対応したウォッチド
ッグタイマは動作が時分割では多重化されていないた
め、処理するプログラムとの間で動作の同期がとれない
ためである。
The reason for the problem of these conventional methods is that, although the programs to be processed are all multiplexed in a time division manner, the operation of the watchdog timer corresponding to each processing program is multiplexed in the time division manner. This is because the operation is not synchronized with the program to be processed.

【0029】本発明は以上の点に鑑みなされたもので、
プログラムの多重化を行うに好適であり、その結果多重
処理を有するプログラムの開発を容易とするデータ処理
システムの暴走検出方法を提供することを目的とする。
The present invention has been made in view of the above points,
An object of the present invention is to provide a method for detecting runaway of a data processing system, which is suitable for multiplexing programs and, as a result, facilitates development of programs having multiplex processing.

【0030】また、本発明の他の目的は、プログラムの
モジュール化を行うに好適であり、その結果プログラム
の資源化を図り、再利用性を高め得るデータ処理システ
ムの暴走検出方法を提供することにある。
Another object of the present invention is to provide a method for detecting runaway of a data processing system, which is suitable for modularizing a program, thereby contributing to resource utilization of the program and improving reusability. It is in.

【0031】[0031]

【課題を解決するための手段】本発明は上記の目的を達
成するため、複数の処理プログラムをレベルに応じた優
先順位のもとに実行するデータ処理システムの暴走発生
を検出する暴走検出方法において、複数の処理プログラ
ムのそれぞれに個別に対応する複数のウォッチドッグタ
イマを配置し、これら複数のウォッチドッグタイマは対
応する処理プログラム内でのみリセット可能であり、複
数のウォッチドッグタイマへのクロックの供給はその時
処理されている処理プログラムに対応したウォッチドッ
グタイマのみに行い、これら複数のウォッチドッグタイ
マのオーバーフローに基づきデータ処理システムの暴走
発生を検出するようにしたものである。
According to the present invention, there is provided a runaway detecting method for detecting runaway of a data processing system which executes a plurality of processing programs in a priority order according to a level. , A plurality of watchdog timers respectively corresponding to a plurality of processing programs are arranged, and these plurality of watchdog timers can be reset only in the corresponding processing program, and supply of a clock to the plurality of watchdog timers Is performed only for the watchdog timer corresponding to the processing program being processed at that time, and detects the occurrence of runaway of the data processing system based on the overflow of the plurality of watchdog timers.

【0032】本発明の暴走検出方法においては、各ウォ
ッチドッグタイマの動作は、その時処理されている処理
プログラムに対応して時分割的、排他的である。すなわ
ち、処理するプログラムは時分割で多重化されているの
に対応して、各処理プログラムに対応したウォッチドッ
グタイマも時分割で多重化されているため、異なるレベ
ルにおけるウォッチドッグタイマの動作を考慮しなくて
もよい。従って、割り込み処理の処理時間と割り込み前
に処理していた処理プログラムに対応するウォッチドッ
グタイマとの間には時間関係が存在しないため、従来の
暴走検出方法で問題となっていた「不定期に発生する割
り込み処理によるウォッチドッグタイマのオーバーフロ
ーの発生」を解決できる。
In the runaway detection method of the present invention, the operation of each watchdog timer is time-divisional and exclusive according to the processing program being processed at that time. In other words, while the programs to be processed are multiplexed in a time-division manner, the watchdog timers corresponding to each processing program are also multiplexed in a time-division manner, so that the operation of the watchdog timer at different levels is considered. You don't have to. Therefore, since there is no time relationship between the processing time of the interrupt processing and the watchdog timer corresponding to the processing program being processed before the interrupt, the problem of the conventional runaway detection method " Occurrence of overflow of watchdog timer due to interrupt processing that occurs ”can be solved.

【0033】また、本発明では、従来の「割り込み処理
の処理プログラムにサイズの変更が発生した時に、他の
プログラムにおいてウォッチドッグタイマのリセットの
位置を変更する必要」が解決される。
Further, the present invention solves the conventional problem that when the size of the interrupt processing program is changed, the watchdog timer reset position must be changed in another program.

【0034】 また、本発明は、複数の処理プログラム
の各処理プログラムの処理期間中に、定期的若しくは不
定期的に発生する第1の割り込み要求に基づいて第1の
割り込み処理が行われた時は、複数の処理プログラムの
ウォッチドッグタイマとは異なる第1の割り込み処理用
のウォッチドッグタイマに対してのみクロックの供給を
行い、かつ、処理プログラムのウォッチドッグタイマに
対するクロックは供給を停止し、割り込み処理終了時に
第1の割り込み処理用のウォッチドッグタイマに対して
リセット信号を供給すると共に、第1の割り込み要求直
前に処理していた処理プログラムの処理を再開し、か
つ、その再開した処理プログラムに対応したウォッチド
ッグタイマのみにクロックを切替供給し、第1の割り込
み処理用のウォッチドッグタイマのオーバーフローに基
づきデータ処理システムの暴走発生を検出するようにし
たものである。
Further, according to the present invention, when the first interrupt processing is performed based on a first interrupt request that occurs periodically or irregularly during the processing period of each processing program of the plurality of processing programs, Supplies a clock only to a first interrupt processing watchdog timer different from the watchdog timers of a plurality of processing programs , and supplies a clock to a watchdog timer of the processing programs.
The supply of the clock is stopped, a reset signal is supplied to the watchdog timer for the first interrupt processing at the end of the interrupt processing, and the processing of the processing program that was being processed immediately before the first interrupt request is restarted. In addition, the clock is switched and supplied only to the watchdog timer corresponding to the restarted processing program, and the runaway of the data processing system is detected based on the overflow of the watchdog timer for the first interrupt processing. is there.

【0035】本発明では、複数の処理プログラムだけで
なく、第1の割り込み要求についても第1の割り込み処
理用のウォッチドッグタイマのオーバーフローに基づき
データ処理システムの暴走発生を検出でき、各処理プロ
グラム内でウォッチドッグタイマのリセットを設定する
時に、割り込み処理などによる多重化の影響を考慮しな
くともよい。
According to the present invention, the runaway of the data processing system can be detected not only for a plurality of processing programs but also for the first interrupt request based on the overflow of the watchdog timer for the first interrupt processing. When setting the reset of the watchdog timer, it is not necessary to consider the influence of multiplexing due to interrupt processing or the like.

【0036】 更に、本発明は第1の割り込み処理の処
理中に、定期的若しくは不定期的に発生する更に即時性
が要求される第2の割り込み要求に基づいて第2の割り
込み処理が行われた時は、第2の割り込み処理用のウォ
ッチドッグタイマに対してのみクロックの供給を行い、
かつ、第1の割り込み処理用のウォッチドッグタイマに
対するクロックは供給を停止し、割り込み処理終了時に
第2の割り込み処理用のウォッチドッグタイマに対して
リセット信号を供給すると共に、第2の割り込み要求直
前に処理していた第1の割り込み処理の処理を再開し、
かつ、その再開した第1の割り込み処理に対応したウォ
ッチドッグタイマのみにクロックを切替供給し、第2の
割り込み処理用のウォッチドッグタイマのオーバーフロ
ーに基づきデータ処理システムの暴走発生を検出するこ
とを特徴とする。
Further, according to the present invention, during the processing of the first interrupt processing, the second interrupt processing is performed based on a second interrupt request that occurs more regularly or irregularly and requires more immediacy. The clock is supplied only to the second interrupt processing watchdog timer,
And the first interrupt processing watchdog timer
The supply of the clock is stopped, a reset signal is supplied to the watchdog timer for the second interrupt processing at the end of the interrupt processing, and the processing of the first interrupt processing performed immediately before the second interrupt request is performed. Resume,
In addition, the clock is switched and supplied only to the watchdog timer corresponding to the restarted first interrupt processing, and the runaway of the data processing system is detected based on the overflow of the watchdog timer for the second interrupt processing. And

【0037】この発明では、第1の割り込み要求よりも
更に優先度の高い第2の割り込み要求についても第2の
割り込み処理用のウォッチドッグタイマのオーバーフロ
ーに基づきデータ処理システムの暴走発生を検出でき、
各処理プログラム内でウォッチドッグタイマのリセット
を設定する時に、割り込み処理などによる多重化の影響
を考慮しなくともよい。
According to the present invention, the runaway of the data processing system can be detected for the second interrupt request having a higher priority than the first interrupt request based on the overflow of the watchdog timer for the second interrupt processing.
When setting the reset of the watchdog timer in each processing program, it is not necessary to consider the influence of multiplexing due to interrupt processing or the like.

【0038】なお、複数のウォッチドッグタイマのリセ
ットの位置は、対応する処理プログラムの総処理時間よ
りも長い値に設定されている。
The reset positions of the plurality of watchdog timers are set to values longer than the total processing time of the corresponding processing program.

【0039】[0039]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面と共に説明する。図1は本発明になる暴走検出方
法の第1の実施の形態の構成図を示す。この第1の実施
の形態は、処理プログラム201と処理プログラム20
2を処理すると共に、処理プログラム201から処理プ
ログラム202が起動された時、及び処理プログラム2
02が終了して処理プログラム201に復帰する時にそ
の時処理しているプログラムの状態を示す信号INT、
RETIを生成する処理手段101と、処理手段101
から出力されるINT信号及びRETI信号に基づい
て、リセット信号及びクロックを発生するリセット・ク
ロック切替回路111と、第1のウォッチドッグタイマ
121及び第2のウォッチドッグタイマ122と、オア
ゲート131とから構成されている。
Next, embodiments of the present invention will be described with reference to the drawings. FIG. 1 shows a configuration diagram of a first embodiment of a runaway detection method according to the present invention. In the first embodiment, a processing program 201 and a processing program 20
2 when the processing program 202 is started from the processing program 201 and when the processing program 2
02 ends and returns to the processing program 201, a signal INT indicating the state of the program being processed at that time,
Processing means 101 for generating RETI, processing means 101
And a reset / clock switching circuit 111 for generating a reset signal and a clock based on the INT signal and the RETI signal output from the CPU, a first watchdog timer 121 and a second watchdog timer 122, and an OR gate 131 Have been.

【0040】リセット・クロック切替回路111は、処
理手段101から出力されるINT信号及びRETI信
号に基づいて、処理手段101が処理プログラム201
を処理している時はウォッチドッグタイマ121にのみ
リセット信号とクロックを供給し、処理手段101が処
理プログラム202を処理している時はウォッチドッグ
タイマ122にのみリセット信号とクロックを供給す
る。オアゲート131は、ウォッチドッグタイマ121
から出力されるオーバーフロー信号と、ウォッチドッグ
タイマ122から出力されるオーバーフロー信号との論
理和をとり、暴走検出信号を生成する。
The reset / clock switching circuit 111 causes the processing means 101 to execute the processing program 201 based on the INT signal and the RETI signal output from the processing means 101.
When the processing unit 101 is processing the processing program 202, the reset signal and the clock are supplied only to the watchdog timer 122. The OR gate 131 is a watchdog timer 121
And the overflow signal output from the watchdog timer 122 is ORed to generate a runaway detection signal.

【0041】図2は図1中の処理手段101で処理され
る処理プログラム201と202をより詳細に示す図で
ある。図2において、第1のレベルの処理プログラム2
01は、初期処理、第1の処理、第1のウォッチドッグ
タイマリセット、n回の第2の処理、第2のウォッチド
ッグタイマリセットを順次に実行した後(ステップ21
1〜215)、第1の処理に戻り、以後ステップ211
〜215の処理を繰り返す。第2のレベルの処理プログ
ラム202は、第1の処理の処理期間中に割り込み処理
I1とウォッチドッグタイマリセットし(ステップ22
1、222)、また第2の処理の処理期間中に割り込み
処理I2とウォッチドッグタイマリセットする(ステッ
プ223、224)。割り込み処理I1及びI2は、即
時性が要求される処理であり、定期的若しくは不定期に
発生する処理である。
FIG. 2 is a diagram showing the processing programs 201 and 202 processed by the processing means 101 in FIG. 1 in more detail. In FIG. 2, a first level processing program 2
01 is after sequentially executing an initial process, a first process, a first watchdog timer reset, n second processes, and a second watchdog timer reset (step 21).
1 to 215), returning to the first processing, and thereafter, to step 211
To 215 are repeated. The second level processing program 202 resets the interrupt processing I1 and the watchdog timer during the processing of the first processing (step 22).
1, 222), and interrupt processing I2 and the watchdog timer are reset during the processing of the second processing (steps 223, 224). The interrupt processes I1 and I2 are processes that require immediacy, and are processes that occur regularly or irregularly.

【0042】図1において、ウォッチドッグタイマ12
1がオーバーフローするまでの時間をT121、図2に
おける第1の処理の処理時間をTa、第2の処理の処理
時間をTbとすると、Ta<T121 かつ n×Tb
<T121となるように、図2のステップ213及びス
テップ215のウォッチドッグタイマのリセットの位置
が設定される。
In FIG. 1, the watchdog timer 12
Assuming that the time until 1 overflows is T121, the processing time of the first processing in FIG. 2 is Ta, and the processing time of the second processing is Tb, Ta <T121 and n × Tb
The reset position of the watchdog timer in steps 213 and 215 in FIG. 2 is set so as to be <T121.

【0043】また、図1において、ウォッチドッグタイ
マ122がオーバーフローするまでの時間をT122、
割り込み処理I1の処理時間をTi1、割り込み処理I
2の処理時間をTi2とすると、Ti1<T122 か
つ Ti2<T122となるように、図2のステップ2
22及びステップ224の各割り込み処理のウォッチド
ッグタイマのリセットの位置が設定される。
In FIG. 1, the time until the watchdog timer 122 overflows is represented by T122.
The processing time of the interrupt processing I1 is Ti1, the interrupt processing I
2 is Ti2 <T122 and Ti2 <T122, assuming that the processing time of Step 2 is Ti2, Step 2 in FIG.
The reset position of the watchdog timer in each of the interrupt processing of step 22 and step 224 is set.

【0044】次に、図1及び図2を参照して本発明の第
1の実施の形態の動作について説明する。図1の処理手
段101は、まず、図2中の第1のレベルの処理プログ
ラム201の初期処理を実行する(ステップ211)。
この初期処理においてウォッチドッグタイマ121及び
122は動作状態に入ると共にリセットされる。その
後、第1の処理を開始する(ステップ212)。このと
き、処理手段101が第1の処理を実行している期間
は、ウォッチドッグタイマ121のみにクロックが供給
され、ウォッチドッグタイマ122にはクロックは供給
されない。
Next, the operation of the first embodiment of the present invention will be described with reference to FIGS. The processing unit 101 in FIG. 1 first executes an initial process of the processing program 201 of the first level in FIG. 2 (step 211).
In this initial processing, the watchdog timers 121 and 122 enter an operating state and are reset. Thereafter, the first process is started (Step 212). At this time, while the processing unit 101 is executing the first processing, the clock is supplied only to the watchdog timer 121 and the clock is not supplied to the watchdog timer 122.

【0045】次に、割り込み要求が発生すると、処理手
段101は第1の処理の実行を中断し、割り込み処理I
1を開始すると共に(ステップ221)、リセット・ク
ロック切替回路111に対しINT信号を発生する。リ
セット・クロック切替回路111は、INT信号により
ウォッチドッグタイマ121へのクロックの供給を停止
し、代わりにウォッチドッグタイマ122へクロックの
供給を開始する。割り込み処理I1が終了すると、ウォ
ッチドッグタイマ122のリセットが行われるが(ステ
ップ222)、このリセットのためのリセット信号はリ
セット・クロック切替回路111によりウォッチドッグ
タイマ122にのみ供給される。
Next, when an interrupt request occurs, the processing means 101 interrupts the execution of the first processing, and the interrupt processing I
1 (step 221), and generates an INT signal to the reset / clock switching circuit 111. The reset / clock switching circuit 111 stops supplying the clock to the watchdog timer 121 by the INT signal, and starts supplying the clock to the watchdog timer 122 instead. When the interrupt processing I1 ends, the watchdog timer 122 is reset (step 222), but a reset signal for this reset is supplied only to the watchdog timer 122 by the reset / clock switching circuit 111.

【0046】その後、処理手段101は第1の処理を再
開する共に、リセット・クロック切替回路111に対し
RETI信号を発生する。リセット・クロック切替回路
111によりウォッチドッグタイマ121へのクロック
供給を再開すると共に、ウォッチドッグタイマ122へ
のクロック供給を停止する。第1の処理の処理が終了す
ると、ウォッチドッグタイマのリセットが行われる(ス
テップ213)が、リセット・クロック切替回路111
により、このリセットのためのリセット信号はウォッチ
ドッグタイマ121のみに供給される。
Thereafter, the processing means 101 restarts the first processing and generates a RETI signal to the reset / clock switching circuit 111. The clock supply to the watchdog timer 121 is restarted by the reset / clock switching circuit 111, and the clock supply to the watchdog timer 122 is stopped. When the first processing is completed, the watchdog timer is reset (step 213).
Accordingly, the reset signal for this reset is supplied only to the watchdog timer 121.

【0047】続いて、第2の処理のn回のループ処理を
開始する(ステップ214)。このとき、処理手段10
1がn回のループ処理の第2の処理を実行している期間
は、ウォッチドッグタイマ121のみにクロックが供給
され、ウォッチドッグタイマ122にはクロックは供給
されない。
Subsequently, n loop processes of the second process are started (step 214). At this time, the processing means 10
While 1 is executing the second processing of the n loop processing, the clock is supplied only to the watchdog timer 121 and the clock is not supplied to the watchdog timer 122.

【0048】次に、割り込み要求が発生すると、処理手
段101は第2の処理の実行を中断し、割り込み処理I
2を開始すると共に(ステップ223)、リセット・ク
ロック切替回路111に対しINT信号を発生する。リ
セット・クロック切替回路111は、INT信号により
ウォッチドッグタイマ121へのクロックの供給を停止
し、代わりにウォッチドッグタイマ122へクロックの
供給を開始する。割り込み処理I2が終了すると、ウォ
ッチドッグタイマ122のリセットが行われるが(ステ
ップ224)、このリセットのためのリセット信号はリ
セット・クロック切替回路111によりウォッチドッグ
タイマ122にのみ供給される。
Next, when an interrupt request occurs, the processing means 101 interrupts the execution of the second processing, and the interrupt processing I
2 is started (step 223), and an INT signal is generated for the reset / clock switching circuit 111. The reset / clock switching circuit 111 stops supplying the clock to the watchdog timer 121 by the INT signal, and starts supplying the clock to the watchdog timer 122 instead. When the interrupt processing I2 ends, the watchdog timer 122 is reset (step 224). A reset signal for this reset is supplied only to the watchdog timer 122 by the reset / clock switching circuit 111.

【0049】その後、処理手段101は第2の処理を再
開する共に、リセット・クロック切替回路111に対し
RETI信号を発生する。リセット・クロック切替回路
111によりウォッチドッグタイマ121へのクロック
供給を再開すると共に、ウォッチドッグタイマ122へ
のクロック供給を停止する。第2の処理の処理が終了す
ると、ウォッチドッグタイマのリセットが行われる(ス
テップ215)が、リセット・クロック切替回路111
により、このリセットのためのリセット信号はウォッチ
ドッグタイマ121のみに供給される。
Thereafter, the processing means 101 restarts the second processing and generates a RETI signal to the reset / clock switching circuit 111. The clock supply to the watchdog timer 121 is restarted by the reset / clock switching circuit 111, and the clock supply to the watchdog timer 122 is stopped. When the processing of the second processing is completed, the watchdog timer is reset (step 215).
Accordingly, the reset signal for this reset is supplied only to the watchdog timer 121.

【0050】以上の説明から、処理手段101が第1の
処理を実行している期間は、ウォッチドッグタイマ12
1のみが動作し、ウォッチドッグタイマのリセットはウ
ォッチドッグタイマ121のみが対象となり、処理手段
101が割り込み処理I1を実行している期間はウォッ
チドッグタイマ122のみが動作し、ウォッチドッグタ
イマのリセットはウォッチドッグタイマ122のみが対
象となることが理解される。
As described above, while the processing means 101 is executing the first processing, the watchdog timer 12
1 only operates, the watchdog timer is reset only for the watchdog timer 121, and only the watchdog timer 122 operates while the processing unit 101 is executing the interrupt processing I1, and the watchdog timer is reset. It is understood that only watchdog timer 122 is of interest.

【0051】第1の処理の処理時間Taとウォッチドッ
グタイマ121のオーバーフロー時間T121、及び割
り込み処理I1の処理時間Ti1とウォッチドッグタイ
マ122のオーバーフロー時間T122は、それぞれ Ta<T121、 Ti1<T122 となるように設定されているので、正常な動作時にはウ
ォッチドッグタイマ121及び122は必ずオーバーフ
ローが発生する前にリセットされるので、暴走検出信号
は発生しない。
The processing time Ta of the first processing and the overflow time T121 of the watchdog timer 121, and the processing time Ti1 of the interrupt processing I1 and the overflow time T122 of the watchdog timer 122 are Ta <T121 and Ti1 <T122, respectively. Thus, during normal operation, the watchdog timers 121 and 122 are always reset before an overflow occurs, and no runaway detection signal is generated.

【0052】一方、第1の処理の実行中に暴走が発生
し、第1の処理の実行時間が異常に長くなった場合は、
ウォッチドッグタイマ121へのリセットが行われない
ので、ウォッチドッグタイマ121のオーバーフローが
発生し、ウォッチドッグタイマ121から暴走検出信号
がオアゲート131を通して出力される。また、割り込
み処理I1の実行期間中に暴走が発生し、割り込み処理
I1の処理時間が異常に長くなった場合はウォッチドッ
グタイマ122へのリセットが行われないので、ウォッ
チドッグタイマ122のオーバーフローが発生し、ウォ
ッチドッグタイマ122から暴走検出信号がオアゲート
131を通して出力される。
On the other hand, if a runaway occurs during the execution of the first process and the execution time of the first process becomes abnormally long,
Since the watchdog timer 121 is not reset, the watchdog timer 121 overflows, and the runaway detection signal is output from the watchdog timer 121 through the OR gate 131. Further, if a runaway occurs during the execution period of the interrupt processing I1 and the processing time of the interrupt processing I1 becomes abnormally long, the watchdog timer 122 is not reset, so that the overflow of the watchdog timer 122 occurs. Then, a runaway detection signal is output from the watchdog timer 122 through the OR gate 131.

【0053】これは第2の処理についても同様であり、
正常な動作時にはウォッチドッグタイマ121及び12
2は必ずオーバーフローが発生する前にリセットされる
ので、暴走検出信号は発生しない。一方、割り込み処理
I2の処理時間が異常に長くなった場合はウォッチドッ
グタイマ122へのリセットが行われないので、ウォッ
チドッグタイマ122のオーバーフローが発生し、ウォ
ッチドッグタイマ122から暴走検出信号がオアゲート
131を通して出力される。
The same applies to the second processing.
During normal operation, watchdog timers 121 and 12
Since 2 is always reset before the overflow occurs, no runaway detection signal is generated. On the other hand, if the processing time of the interrupt processing I2 becomes abnormally long, the reset of the watchdog timer 122 is not performed, so that an overflow of the watchdog timer 122 occurs, and the runaway detection signal is output from the watchdog timer 122 to the OR gate 131. Is output through

【0054】以上述べたように、図1の第1の実施の形
態によって、多重化された処理において暴走検出が可能
であることが理解される。
As described above, it is understood that runaway detection is possible in the multiplexed processing according to the first embodiment of FIG.

【0055】ところで、図1に示した第1の実施の形態
においては、第1の処理の修正が必要となり、第1の処
理の処理時間が増大した場合、プログラムの修正は第1
の処理の処理時間Taとウォッチドッグタイマ121の
オーバーフロー時間T121が Ta<T121 なる関係を満たすように第1の処理を修正することによ
り、他の処理を一切修正する必要がない。このことは、
第2の処理、割り込み処理I1及び割り込み処理I2に
ついても同様で、これら4つの処理は他の処理とは独立
に修正することができる。
By the way, in the first embodiment shown in FIG. 1, it is necessary to modify the first processing, and when the processing time of the first processing is increased, the modification of the program is performed by the first processing.
By modifying the first processing so that the processing time Ta of the processing and the overflow time T121 of the watchdog timer 121 satisfy the relationship of Ta <T121, it is not necessary to modify other processing at all. This means
The same applies to the second process, the interrupt process I1 and the interrupt process I2, and these four processes can be modified independently of the other processes.

【0056】図3は図1中のリセット・クロック切替回
路111の一例の回路図を示す。2入力オアゲート31
4、315の一方の入力端子には入力端子311、31
2を介してINT信号、RETI信号が入力され、他方
の入力端子には他方の出力端子が接続され、フリップフ
ロップを構成している。これにより、割り込み処理が発
生したとき図1の処理手段101からINT信号が出力
されて端子311を介してノアゲート314の一方の入
力端子に入力され、ノアゲート315から”1”の信号
が出力される。また、RETI信号が端子312を介し
てノアゲート315に入力されたときには、ノアゲート
315から”0”の信号が出力される。
FIG. 3 is a circuit diagram showing an example of the reset / clock switching circuit 111 in FIG. 2-input OR gate 31
4 and 315, input terminals 311 and 31
2, an INT signal and a RETI signal are input, and the other input terminal is connected to the other output terminal to constitute a flip-flop. As a result, when an interrupt process occurs, the INT signal is output from the processing means 101 in FIG. 1 and is input to one input terminal of the NOR gate 314 via the terminal 311, and a “1” signal is output from the NOR gate 315. . When the RETI signal is input to the NOR gate 315 via the terminal 312, a signal of “0” is output from the NOR gate 315.

【0057】次に、この回路の動作について説明する。
初期処理中でウォッチドッグタイマの動作許可がなされ
た時点よりクロック発生回路321からクロックが発生
開始される。このクロックはアンドゲート317及び3
20にそれぞれ供給される。また、システム起動時及び
割り込み処理からの起動時には、図1の処理手段101
から発生されたRETI信号が端子312を介してノア
ゲート315に入力され、ノアゲート315から”0”
の信号が出力され、アンドゲート319及び320の各
一方の入力端子に入力され、これらをゲート「閉」状態
とする。
Next, the operation of this circuit will be described.
The clock generation circuit 321 starts generating a clock from the time when the operation of the watchdog timer is permitted during the initial processing. This clock is supplied to AND gates 317 and 3
20 respectively. Also, at the time of starting the system and starting from the interrupt processing, the processing unit 101 of FIG.
Is input to the NOR gate 315 via the terminal 312, and "0" is output from the NOR gate 315.
Is input to one input terminal of each of the AND gates 319 and 320, and these are set to the gate “closed” state.

【0058】また、これと同時にインバータ316を介
してアンドゲート317及び318の各一方の入力端子
に”1”の信号が入力されて、これらをゲート「開」状
態とする。一方、入力端子313には処理手段101か
らウォッチドッグタイマリセット信号が入力されてアン
ドゲート317及び319にそれぞれ供給される。
At the same time, a signal of "1" is input to one input terminal of each of the AND gates 317 and 318 via the inverter 316, and these are set to the gate "open" state. On the other hand, a watchdog timer reset signal is input to the input terminal 313 from the processing means 101 and supplied to the AND gates 317 and 319, respectively.

【0059】これにより、第1の処理及び第2の処理の
実行期間中は、クロック発生回路321からのクロック
はアンドゲート318を通してウォッチドッグタイマ1
21にのみ供給され、リセット信号はアンドゲート31
7を通してウォッチドッグタイマ121にのみ供給され
る。
Thus, during the execution of the first processing and the second processing, the clock from the clock generation circuit 321 is supplied to the watchdog timer 1 through the AND gate 318.
The reset signal is supplied to the AND gate 31 only.
7, and is supplied only to the watchdog timer 121.

【0060】他方、割り込み処理が発生した時には、図
1の処理手段101から発生されたINT信号が端子3
11を介してノアゲート314に入力され、ノアゲート
315から”1”の信号が出力され、アンドゲート31
9及び320の各一方の入力端子に入力され、これらを
ゲート「開」状態とする。また、これと同時にインバー
タ316を介してアンドゲート317及び318の各一
方の入力端子に”0”の信号が入力されて、これらをゲ
ート「閉」状態とする。これにより、割り込み処理の実
行期間中は、クロック発生回路321からのクロックは
アンドゲート320を通してウォッチドッグタイマ12
2にのみ供給され、リセット信号はアンドゲート319
を通してウォッチドッグタイマ122にのみ供給され
る。
On the other hand, when the interrupt processing occurs, the INT signal generated from the processing means 101 in FIG.
11 to the NOR gate 314, the NOR gate 315 outputs a signal of "1", and the AND gate 31
9 and 320 are input to one of the input terminals, and these are set to the gate "open" state. At the same time, a signal of "0" is input to one input terminal of each of the AND gates 317 and 318 via the inverter 316, and these are set to the gate "closed" state. Thus, during the execution period of the interrupt processing, the clock from the clock generation circuit 321 is supplied to the watchdog timer 12 through the AND gate 320.
2 and the reset signal is supplied to the AND gate 319
Is supplied only to the watchdog timer 122 through

【0061】次に、本発明の第2の実施の形態について
説明する。図4は本発明になる暴走検出方法の第2の実
施の形態の構成図を示す。この第2の実施の形態は、処
理プログラム501と処理プログラム502と処理プロ
グラム503とを処理すると共に、その時処理している
プログラムの優先度を示す信号P1及びP2を生成する
処理手段401と、処理手段401から出力される優先
度を示す信号P1及びP2に基づいて、リセット信号及
びクロックを発生するリセット・クロック切替回路41
1と、第1のウォッチドッグタイマ421、第2のウォ
ッチドッグタイマ422及び第3のウォッチドッグタイ
マ423と、オアゲート431とから構成されている。
Next, a second embodiment of the present invention will be described. FIG. 4 shows a configuration diagram of a second embodiment of the runaway detection method according to the present invention. The second embodiment includes a processing unit 401 that processes a processing program 501, a processing program 502, and a processing program 503, and generates signals P1 and P2 indicating the priority of the program being processed at that time. A reset / clock switching circuit 41 for generating a reset signal and a clock based on the priority signals P1 and P2 output from the means 401;
1, a first watchdog timer 421, a second watchdog timer 422, a third watchdog timer 423, and an OR gate 431.

【0062】リセット・クロック切替回路411は、処
理手段401から出力される優先度を示す信号P1及び
P2に基づいて、処理手段401が処理プログラム50
1を処理している時はウォッチドッグタイマ421にの
みリセット信号とクロックを供給し、処理手段401が
処理プログラム502を処理している時はウォッチドッ
グタイマ422にのみリセット信号とクロックを供給
し、処理手段401が処理プログラム503を処理して
いる時はウォッチドッグタイマ423にのみリセット信
号とクロックを供給する。オアゲート431は、ウォッ
チドッグタイマ421、422及び423から出力され
るオーバーフロー信号の論理和をとり、暴走検出信号を
生成する。
The reset / clock switching circuit 411 allows the processing means 401 to execute the processing program 50 based on the signals P1 and P2 indicating the priority output from the processing means 401.
1 is supplied with the reset signal and the clock only to the watchdog timer 421, and when the processing means 401 is processing the processing program 502, the reset signal and the clock are supplied only to the watchdog timer 422. When the processing means 401 is processing the processing program 503, it supplies a reset signal and a clock only to the watchdog timer 423. The OR gate 431 calculates the logical sum of the overflow signals output from the watchdog timers 421, 422, and 423, and generates a runaway detection signal.

【0063】図5は図4中の処理手段401で処理され
る処理プログラム501、502及び503をより詳細
に示す図である。図5において、第1のレベルの処理プ
ログラム501は、初期処理、第1の処理、第1のウォ
ッチドッグタイマリセット、n回の第2の処理、第2の
ウォッチドッグタイマリセットを順次に実行した後(ス
テップ511〜515)、第1の処理に戻り、以後ステ
ップ511〜515の処理を繰り返す。
FIG. 5 is a diagram showing the processing programs 501, 502 and 503 processed by the processing means 401 in FIG. 4 in more detail. In FIG. 5, a first level processing program 501 sequentially executes an initial process, a first process, a first watchdog timer reset, n second processes, and a second watchdog timer reset. Thereafter (steps 511 to 515), the process returns to the first process, and thereafter, the processes of steps 511 to 515 are repeated.

【0064】第2のレベルの処理プログラム502は、
第1の処理の処理期間中に割り込み処理I1とウォッチ
ドッグタイマリセットする(ステップ521、52
2)。また、第3のレベルの処理プログラム503は、
割り込み処理I1の処理期間中に、割り込み処理I2と
ウォッチドッグタイマリセットし(ステップ531、5
32)、第2の処理の処理期間中に割り込み処理I3と
ウォッチドッグタイマリセットする(ステップ533、
534)。割り込み処理I1は、即時性が要求される処
理であり、定期的若しくは不定期に発生する処理であ
る。割り込み処理I2及びI3は、割り込み処理I1よ
りも更に即時性が要求される処理であり、定期的若しく
は不定期に発生する処理である。
The second level processing program 502 is:
During the processing of the first processing, the interrupt processing I1 and the watchdog timer are reset (steps 521 and 52).
2). Also, the third level processing program 503 is:
During the processing period of the interrupt process I1, the interrupt process I2 and the watchdog timer are reset (steps 531 and 531).
32), interrupt processing I3 and watchdog timer reset during the processing period of the second processing (step 533,
534). The interrupt process I1 is a process that requires immediacy, and is a process that occurs periodically or irregularly. The interrupt processes I2 and I3 are processes that require more immediacy than the interrupt process I1, and are processes that occur periodically or irregularly.

【0065】図4において、ウォッチドッグタイマ42
1がオーバーフローするまでの時間をT421、図5に
おける第1の処理の処理時間をTa、第2の処理の処理
時間をTbとすると、Ta<T421 かつ n×Tb
<T421となるように、図5のステップ513及びス
テップ515のウォッチドッグタイマのリセットの位置
が設定される。
In FIG. 4, watchdog timer 42
Assuming that T421 is the time until 1 overflows, Ta is the processing time of the first processing in FIG. 5, and Tb is the processing time of the second processing in FIG. 5, Ta <T421 and n × Tb
The reset position of the watchdog timer in steps 513 and 515 in FIG. 5 is set so that <T421 is satisfied.

【0066】また、図4において、ウォッチドッグタイ
マ422、423がオーバーフローするまでの時間をT
422、T423、割り込み処理I1の処理時間をTi
1、割り込み処理I2の処理時間をTi2、割り込み処
理I3の処理時間をTi3とすると、 Ti1<T422、Ti2<T423、Ti3<T42
3 となるように、図4のステップ522、ステップ532
及びステップ534の各割り込み処理のウォッチドッグ
タイマのリセットの位置が設定される。
In FIG. 4, the time until the watchdog timers 422 and 423 overflow is represented by T.
422, T423, the processing time of the interrupt processing I1 is Ti
1. Assuming that the processing time of the interrupt processing I2 is Ti2 and the processing time of the interrupt processing I3 is Ti3, Ti1 <T422, Ti2 <T423, Ti3 <T42
3 so that step 522 and step 532 in FIG.
Then, the reset position of the watchdog timer for each interrupt processing in step 534 is set.

【0067】図1の第1の実施の形態と図4の第2の実
施の形態の違いは、図1の第1の実施の形態において
は、各ウォッチドッグタイマへのリセット・クロックの
切り換えを、処理手段101が処理を第1のレベルの処
理プログラム201から第2のレベルの処理プログラム
202へ移行するときに発生するINT信号と、第2の
レベルの処理プログラム202から第1のレベルの処理
プログラム201に復帰する時に発生するRETI信号
に基づいて行うのに対し、図4の実施の形態において
は、処理手段401がどのレベルの処理プログラムを処
理しているかを直接P1、P2信号として発生し、P
1、P2信号に基づいて切り換えを行う点にある。ま
た、図1の実施の形態においては処理が二重に多重化さ
れているのに対し、図4の実施の形態においては、処理
が三重に多重化されている点も異なる。
The difference between the first embodiment of FIG. 1 and the second embodiment of FIG. 4 is that, in the first embodiment of FIG. 1, the switching of the reset clock to each watchdog timer is performed. An INT signal generated when the processing means 101 shifts the processing from the first level processing program 201 to the second level processing program 202, and the processing of the second level processing program 202 to the first level processing. In contrast to the RETI signal generated when returning to the program 201, in the embodiment of FIG. 4, the level of the processing program that the processing means 401 is processing is directly generated as the P1 and P2 signals. , P
1, in that switching is performed based on the P2 signal. Further, in the embodiment of FIG. 1, the processing is double-multiplexed, whereas in the embodiment of FIG. 4, the processing is triple-multiplexed.

【0068】次に、図4及び図5を参照して本発明の第
2の実施の形態の動作について説明する。図4の処理手
段401は、まず、図5中の第1のレベルの処理プログ
ラム501の初期処理を実行する(ステップ511)。
この初期処理においてウォッチドッグタイマ421〜4
23は動作状態に入ると共にリセットされる。その後、
第1の処理を開始する(ステップ512)。このとき、
処理手段401が第1の処理を実行している期間は、ウ
ォッチドッグタイマ421のみにクロックが供給され、
ウォッチドッグタイマ422及び423にはクロックは
供給されない。
Next, the operation of the second embodiment of the present invention will be described with reference to FIGS. The processing unit 401 in FIG. 4 first executes an initial process of the first level processing program 501 in FIG. 5 (step 511).
In this initial processing, the watchdog timers 421 to 4
23 is reset upon entering the operating state. afterwards,
The first process is started (Step 512). At this time,
While the processing unit 401 is executing the first process, the clock is supplied only to the watchdog timer 421,
No clock is supplied to the watchdog timers 422 and 423.

【0069】次に、割り込み要求が発生すると、処理手
段401は第1の処理の実行を中断し、割り込み処理I
1を開始すると共に(ステップ521)、リセット・ク
ロック切替回路411に対し信号P1及びP2を発生す
る。リセット・クロック切替回路411は、信号P1及
びP2によりウォッチドッグタイマ421へのクロック
の供給を停止し、代わりにウォッチドッグタイマ422
へクロックの供給を開始する。
Next, when an interrupt request occurs, the processing means 401 interrupts the execution of the first processing, and the interrupt processing I
1 (step 521), and generates signals P1 and P2 to the reset / clock switching circuit 411. The reset / clock switching circuit 411 stops the supply of the clock to the watchdog timer 421 by the signals P1 and P2, and
Start supplying the clock to.

【0070】更に、割り込み処理I1の処理中に、より
優先度の高い割込要求が発生すると、処理手段401は
割り込み処理I1の処理を中断し、割り込み処理I2の
処理を開始する(ステップ531)。このとき、リセッ
ト・クロック切替回路411は、信号P1及びP2によ
りウォッチドッグタイマ422へのクロックの供給を停
止し、代わりにウォッチドッグタイマ423へクロック
の供給を開始する。
Further, when an interrupt request having a higher priority occurs during the processing of the interrupt processing I1, the processing means 401 interrupts the processing of the interrupt processing I1 and starts the processing of the interrupt processing I2 (step 531). . At this time, the reset / clock switching circuit 411 stops supplying the clock to the watchdog timer 422 by the signals P1 and P2, and starts supplying the clock to the watchdog timer 423 instead.

【0071】割り込み処理I2が終了すると、ウォッチ
ドッグタイマ423のリセットが行われるが(ステップ
532)、このリセットのためのリセット信号はリセッ
ト・クロック切替回路411によりウォッチドッグタイ
マ423にのみ供給される。
When the interrupt processing I2 ends, the watchdog timer 423 is reset (step 532). A reset signal for this reset is supplied only to the watchdog timer 423 by the reset / clock switching circuit 411.

【0072】その後、処理手段401は割り込み処理I
1の処理を再開するが、この時リセット・クロック切替
回路411によりウォッチドッグタイマ422へのクロ
ック供給が再開されると共に、ウォッチドッグタイマ4
23へのクロック供給が停止される。その後、割り込み
処理I1の処理が終了すると、ウォッチドッグタイマの
リセットが行われるが(ステップ522)、リセット・
クロック切替回路411によりこのリセットはウォッチ
ドッグタイマ422のみに対して行われる。
Thereafter, the processing means 401 executes the interrupt processing I
1, the clock supply to the watchdog timer 422 is restarted by the reset / clock switching circuit 411 and the watchdog timer 4
The clock supply to 23 is stopped. Thereafter, when the interrupt processing I1 is completed, the watchdog timer is reset (step 522).
This reset is performed only by the watchdog timer 422 by the clock switching circuit 411.

【0073】その後、処理手段401は第1の処理の実
行を再開するが、このときリセット・クロック切替回路
411によりウォッチドッグタイマ421へのクロック
供給が再開されると共に、ウォッチドッグタイマ422
へのクロックは供給が停止される。第1の処理の実行が
終了すると、ウォッチドッグタイマのリセットが行われ
る(ステップ513)。このリセットはリセット・クロ
ック切替回路411により、ウォッチドッグタイマ42
1のみに対して行われる。
Thereafter, the processing means 401 restarts the execution of the first processing. At this time, the clock supply to the watchdog timer 421 is restarted by the reset / clock switching circuit 411 and the watchdog timer 422 is restarted.
The supply of the clock to is stopped. When the execution of the first process ends, the watchdog timer is reset (step 513). This reset is performed by the reset / clock switching circuit 411 by the watchdog timer 42.
This is done for only one.

【0074】続いて、第2の処理のn回のループ処理を
開始する(ステップ514)。このとき、処理手段40
1がn回のループ処理の第2の処理を実行している期間
は、ウォッチドッグタイマ421のみにクロックが供給
され、ウォッチドッグタイマ422及び423にはクロ
ックは供給されない。
Subsequently, the loop processing of the second processing is started n times (step 514). At this time, the processing means 40
While 1 is executing the second processing of the loop processing n times, the clock is supplied only to the watchdog timer 421, and the clock is not supplied to the watchdog timers 422 and 423.

【0075】次に、割り込み要求が発生すると、処理手
段401は第2の処理の実行を中断し、割り込み処理I
3を開始すると共に(ステップ533)、リセット・ク
ロック切替回路411に対し信号P1及びP2を出力す
る。リセット・クロック切替回路111は、これにより
ウォッチドッグタイマ421へのクロックの供給を停止
し、代わりにウォッチドッグタイマ423へクロックの
供給を開始する。割り込み処理I3が終了すると、ウォ
ッチドッグタイマ423のリセットが行われるが(ステ
ップ534)、このリセットのためのリセット信号はリ
セット・クロック切替回路411によりウォッチドッグ
タイマ423にのみ供給される。
Next, when an interrupt request occurs, the processing means 401 interrupts the execution of the second processing, and the interrupt processing I
3 (step 533), and outputs signals P1 and P2 to the reset / clock switching circuit 411. As a result, the reset / clock switching circuit 111 stops supplying the clock to the watchdog timer 421 and starts supplying the clock to the watchdog timer 423 instead. When the interrupt processing I3 ends, the watchdog timer 423 is reset (step 534). A reset signal for this reset is supplied only to the watchdog timer 423 by the reset / clock switching circuit 411.

【0076】その後、処理手段401は第2の処理を再
開する共に、リセット・クロック切替回路411に対し
信号P1、P2を発生する。リセット・クロック切替回
路411はウォッチドッグタイマ421へのクロック供
給を再開すると共に、ウォッチドッグタイマ423への
クロック供給を停止する。第2の処理の処理が終了する
と、ウォッチドッグタイマのリセットが行われる(ステ
ップ515)が、リセット・クロック切替回路411に
より、このリセットのためのリセット信号はウォッチド
ッグタイマ421のみに供給される。
Thereafter, the processing means 401 restarts the second processing and generates signals P1 and P2 to the reset / clock switching circuit 411. The reset / clock switching circuit 411 resumes the clock supply to the watchdog timer 421 and stops the clock supply to the watchdog timer 423. When the second processing is completed, the watchdog timer is reset (step 515). The reset / clock switching circuit 411 supplies a reset signal for this reset only to the watchdog timer 421.

【0077】以上の説明から、処理手段401が第1の
処理を実行している期間は、ウォッチドッグタイマ42
1のみが動作し、ウォッチドッグタイマのリセットはウ
ォッチドッグタイマ421のみが対象となり、処理手段
401が割り込み処理I1を実行している期間はウォッ
チドッグタイマ422のみが動作し、ウォッチドッグタ
イマのリセットはウォッチドッグタイマ422のみが対
象となることが理解される。また、処理手段401が割
り込み処理I2又はI3を実行している期間はウォッチ
ドッグタイマ423のみが動作し、ウォッチドッグタイ
マのリセットはウォッチドッグタイマ423のみが対象
となることが理解される。
As described above, while the processing means 401 is executing the first processing, the watchdog timer 42
1 only operates, the watchdog timer is reset only for the watchdog timer 421, and only the watchdog timer 422 operates while the processing unit 401 is executing the interrupt processing I1, and the watchdog timer is reset. It is understood that only watchdog timer 422 is of interest. Further, it is understood that only the watchdog timer 423 operates while the processing unit 401 is executing the interrupt processing I2 or I3, and the reset of the watchdog timer is performed only by the watchdog timer 423.

【0078】ここで、第1の処理の処理時間Taとウォ
ッチドッグタイマ421のオーバーフロー時間T421
及び割り込み処理I1、I2、I3の処理時間Ti1、
Ti2、Ti3とウォッチドッグタイマ422、423
のオーバーフロー時間T422、T423は前述の通り
Ta<T421、Ti1<T422、Ti2<T42
3、Ti3<T423となるように設定されているの
で、正常な動作時にはウォッチドッグタイマ421、4
22、423は必ずオーバーフローが発生する前にリセ
ットされ、暴走検出信号は発生しない。
Here, the processing time Ta of the first processing and the overflow time T421 of the watchdog timer 421
And the processing time Ti1 of the interrupt processing I1, I2, I3,
Ti2, Ti3 and watchdog timers 422, 423
As described above, the overflow times T422 and T423 of Ta <T421, Ti1 <T422, and Ti2 <T42
3, since Ti3 <T423, the watchdog timers 421, 4
22 and 423 are always reset before an overflow occurs, and no runaway detection signal is generated.

【0079】一方、第1の処理の実行中に暴走が発生
し、第1の処理の実行時間が異常に長くなった場合は、
ウォッチドッグタイマ421へのリセットが行われない
ので、ウォッチドッグタイマ421のオーバーフローが
発生し、暴走検出信号が発生する。また、割り込み処理
I1の処理中に暴走が発生し、割り込み処理I1の実行
時間が異常に長くなった場合はウォッチドッグタイマ4
22へのリセットが行われないので、ウォッチドッグタ
イマ422のオーバーフローが発生し、暴走検出信号が
発生する。
On the other hand, if a runaway occurs during the execution of the first process and the execution time of the first process becomes abnormally long,
Since the reset of the watchdog timer 421 is not performed, an overflow of the watchdog timer 421 occurs, and a runaway detection signal is generated. If a runaway occurs during the processing of the interrupt processing I1 and the execution time of the interrupt processing I1 becomes abnormally long, the watchdog timer 4
Since reset to 22 is not performed, overflow of the watchdog timer 422 occurs, and a runaway detection signal is generated.

【0080】更に、割り込み処理I2、I3の各実行中
に暴走が発生し、割り込み処理I2、I3の実行時間が
異常に長くなった場合は、ウォッチドッグタイマ423
へのリセットが行われないので、ウォッチドッグタイマ
423のオーバーフローが発生し、暴走検出信号が発生
する。
Further, if a runaway occurs during the execution of each of the interrupt processes I2 and I3 and the execution time of the interrupt processes I2 and I3 becomes abnormally long, the watchdog timer 423
Is not performed, an overflow of the watchdog timer 423 occurs, and a runaway detection signal is generated.

【0081】以上述べたように、図4の第2の実施の形
態によっても、多重化された処理において暴走検出が可
能であることが理解される。また、図4の第2の実施の
形態においても、多重処理を含むループが暴走しても暴
走検出が可能であることが理解される。
As described above, it can be understood that runaway detection is also possible in the multiplexed processing according to the second embodiment shown in FIG. It is also understood that the runaway can be detected even in the loop including the multiplex processing even in the second embodiment shown in FIG.

【0082】ところで、図4の第2の実施の形態におい
ては、第1の処理の修正が必要となり、第1の処理の処
理時間が増大した場合、プログラムの修正は第1の処理
の処理時間Taとウォッチドッグタイマ421のオーバ
ーフロー時間T421が Ta<T421 を満たされるように第1の処理を修正することにより、
他の処理を一切修正する必要がない。
In the second embodiment shown in FIG. 4, when the first processing needs to be modified, and when the processing time of the first processing is increased, the modification of the program is performed by the processing time of the first processing. By modifying the first processing so that Ta and the overflow time T421 of the watchdog timer 421 satisfy Ta <T421,
No other processing needs to be modified.

【0083】このことは、第2の処理、割り込み処理I
1〜I3に関しても同様である。これらの処理は他の処
理とは全く独立に修正することが可能である。
This means that the second processing, the interrupt processing I
The same applies to 1 to I3. These processes can be modified completely independently of other processes.

【0084】図6は図4中のリセット・クロック切替回
路411の一例の回路図を示す。図6において、クロッ
ク発生回路624は、図5のステップ511の初期処理
中でウォッチドッグタイマの動作許可がなされた時点よ
り動作開始してクロックを発生して2入力アンドゲート
619、621及び623の各一方の入力端子に入力す
る。割り込み処理が発生した時、前記処理手段401は
その割り込み処理の優先度に従ってその割り込み処理の
処理期間中、図5のP1、P2信号を発生する。
FIG. 6 is a circuit diagram showing an example of the reset / clock switching circuit 411 in FIG. 6, the clock generation circuit 624 starts the operation from the point in time when the operation of the watchdog timer is permitted during the initial processing of step 511 in FIG. 5, generates a clock, and outputs the two-input AND gates 619, 621, and 623. Input to one of the input terminals. When an interrupt process occurs, the processing means 401 generates the P1 and P2 signals of FIG. 5 during the process of the interrupt process according to the priority of the interrupt process.

【0085】図5のステップ512の第1の処理及びス
テップ514の第2の処理の処理期間中は、P1=0、
P2=0であるので、図6の入力端子611よりの信号
P1がインバータ616を介して入力され、かつ、入力
端子612よりの信号P2がインバータ617を介して
入力されるアンドゲート614の出力信号が”1”とな
り、信号P1が直接に入力されるアンドゲート615の
出力信号が”0”となるので、アンドゲート614の出
力信号が入力されるアンドゲート618及び619がそ
れぞれゲート「開」状態となる。
During the processing period of the first processing of Step 512 and the second processing of Step 514 in FIG. 5, P1 = 0,
Since P2 = 0, the signal P1 from the input terminal 611 in FIG. 6 is input via the inverter 616, and the signal P2 from the input terminal 612 is input via the inverter 617. The output signal of the AND gate 614 Becomes "1", and the output signal of the AND gate 615 to which the signal P1 is directly inputted becomes "0". Therefore, the AND gates 618 and 619 to which the output signal of the AND gate 614 is inputted are in the gate "open" state, respectively. Becomes

【0086】一方、アンドゲート615の出力信号が入
力されるアンドゲート620及び621と、信号P2が
入力されるアンドゲート622及び623はいずれもゲ
ート「閉」状態となる。従って、第1の処理及び第2の
処理の処理期間中はアンドゲート618を通して入力端
子613よりのリセット信号がウォッチドッグタイマ4
21にのみ出力され、アンドゲート619を通してクロ
ック発生回路624よりのクロックがウォッチドッグタ
イマ421のみに出力される。
On the other hand, the AND gates 620 and 621 to which the output signal of the AND gate 615 is input and the AND gates 622 and 623 to which the signal P2 is input are both in the gate "closed" state. Therefore, during the processing period of the first processing and the second processing, the reset signal from the input terminal 613 is output from the input terminal 613 through the AND gate 618.
21, and the clock from the clock generation circuit 624 is output only to the watchdog timer 421 through the AND gate 619.

【0087】また、割り込み処理I1の処理期間中は、
P1=1、P2=0であるので、アンドゲート615の
出力信号は”1”、アンドゲート614の出力信号は”
0”であり、アンドゲート620を通して入力端子61
3よりのリセット信号がウォッチドッグタイマ422に
のみ出力され、アンドゲート621を通してクロック発
生回路624よりのクロックがウォッチドッグタイマ4
22のみに出力される。
During the processing of the interrupt processing I1,
Since P1 = 1 and P2 = 0, the output signal of the AND gate 615 is “1” and the output signal of the AND gate 614 is “1”.
0 "and the input terminal 61 through the AND gate 620.
3 is output only to the watchdog timer 422, and the clock from the clock generation circuit 624 is supplied to the watchdog timer 4 via the AND gate 621.
22 only.

【0088】更に、割り込み処理I2、I3の処理期間
中は、P2=1であるので、アンドゲート614及び6
15の各出力信号はいずれも”0”であり、かつ、アン
ドゲート622及び623がそれぞれゲート「開」状態
となるので、アンドゲート622を通して入力端子61
3よりのリセット信号がウォッチドッグタイマ423に
のみ出力され、アンドゲート623を通してクロック発
生回路624よりのクロックがウォッチドッグタイマ4
23のみに出力される。
Further, since P2 = 1 during the processing period of the interrupt processing I2, I3, the AND gates 614 and 6
15 is “0”, and the AND gates 622 and 623 are in the “open” state, respectively.
3 is output only to the watchdog timer 423, and the clock from the clock generation circuit 624 is supplied to the watchdog timer 4 via the AND gate 623.
23 only.

【0089】[0089]

【発明の効果】以上説明したように、本発明によれば、
処理するプログラムは時分割で多重化されているのに対
応して、各処理プログラムに対応したウォッチドッグタ
イマも時分割で多重化されているため、異なるレベルに
おけるウォッチドッグタイマの動作を考慮しなくてもよ
いため、プログラムの多重化が容易にでき、その結果多
重処理を有するプログラムの開発を容易にできる。
As described above, according to the present invention,
Since the programs to be processed are multiplexed in a time division manner, the watchdog timers corresponding to each processing program are also multiplexed in a time division manner. Therefore, it is possible to easily multiplex programs, and as a result, it is possible to easily develop a program having multiplex processing.

【0090】また、本発明によれば、各処理プログラム
内でウォッチドッグタイマのリセットを設定する時に、
割り込み処理などによる多重化の影響を考慮しなくとも
よいため、プログラムのモジュール化が容易にでき、そ
の結果プログラムの資源化を図り、再利用性を高めるこ
とができる。
According to the present invention, when the reset of the watchdog timer is set in each processing program,
Since it is not necessary to consider the effects of multiplexing due to interrupt processing or the like, the program can be easily modularized. As a result, the resources of the program can be achieved and the reusability can be improved.

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

【図1】本発明の第1の実施の形態の構成図である。FIG. 1 is a configuration diagram of a first embodiment of the present invention.

【図2】図1中の処理手段で処理される処理プログラム
をより詳細に示す図である。
FIG. 2 is a diagram showing in more detail a processing program processed by a processing means in FIG. 1;

【図3】図1中のリセット・クロック切替回路の一例の
回路図である。
FIG. 3 is a circuit diagram of an example of a reset / clock switching circuit in FIG. 1;

【図4】本発明の第2の実施の形態の構成図である。FIG. 4 is a configuration diagram of a second embodiment of the present invention.

【図5】図4中の処理手段で処理される処理プログラム
をより詳細に示す図である。
FIG. 5 is a diagram showing in more detail a processing program processed by the processing means in FIG. 4;

【図6】図4中のリセット・クロック切替回路の一例の
回路図である。
FIG. 6 is a circuit diagram of an example of a reset / clock switching circuit in FIG. 4;

【図7】従来の暴走検出方法の一例を示す図である。FIG. 7 is a diagram showing an example of a conventional runaway detection method.

【図8】図7の処理プログラムの第1の例のフローチャ
ートである。
FIG. 8 is a flowchart of a first example of the processing program of FIG. 7;

【図9】図7の処理プログラムの第2の例のフローチャ
ートである。
FIG. 9 is a flowchart of a second example of the processing program of FIG. 7;

【図10】図7の処理プログラムの第3の例のフローチ
ャートである。
FIG. 10 is a flowchart of a third example of the processing program of FIG. 7;

【図11】従来の暴走検出方法の他の例を示す図であ
る。
FIG. 11 is a diagram showing another example of a conventional runaway detection method.

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

101、401 処理手段 111、411 リセット・クロック切替回路 121、122、421、422、423 ウォッチド
ッグタイマ 131、431 オアゲート 201、202、501〜503 処理プログラム
101, 401 Processing means 111, 411 Reset / clock switching circuit 121, 122, 421, 422, 423 Watchdog timer 131, 431 OR gate 201, 202, 501-503 Processing program

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数の処理プログラムをレベルに応じた
優先順位のもとに実行するデータ処理システムの暴走発
生を検出する暴走検出方法において、 前記複数の処理プログラムのそれぞれに個別に対応する
複数のウォッチドッグタイマを配置し、前記複数の処理
プログラムの各処理プログラムの処理期間中に、定期的
若しくは不定期的に発生する第1の割り込み要求に基づ
いて第1の割り込み処理が行われた時は、前記複数の処
理プログラムのウォッチドッグタイマとは異なる第1の
割り込み処理用のウォッチドッグタイマに対してのみク
ロックの供給を行い、かつ、前記処理プログラムのウォ
ッチドックタイマに対するクロックは供給を停止し、該
割り込み処理終了時に該第1の割り込み処理用のウォッ
チドッグタイマに対してリセット信号を供給すると共
に、前記第1の割り込み要求直前に処理していた処理プ
ログラムの処理を再開し、かつ、その再開した処理プロ
グラムに対応したウォッチドッグタイマのみにクロック
を切替供給することにより、前記処理プログラムのウォ
ッチドッグタイマのオーバーフロー、又は前記第1の割
り込み処理用のウォッチドッグタイマのオーバーフロー
に基づき前記データ処理システムの暴走発生を検出する
ことを特徴とするデータ処理システムの暴走検出方法。
1. A runaway detection method for detecting the occurrence of a runaway of a data processing system that executes a plurality of processing programs in a priority order according to a level, wherein the plurality of processing programs individually correspond to the plurality of processing programs. A watchdog timer is arranged, and during a processing period of each processing program of the plurality of processing programs, when a first interrupt processing is performed based on a first interrupt request that occurs periodically or irregularly, Supplying a clock only to a watchdog timer for a first interrupt process different from the watchdog timers of the plurality of processing programs, and stopping supplying a clock to a watchdog timer of the processing program; At the end of the interrupt processing, a reset signal is sent to the watchdog timer for the first interrupt processing. And restarts the processing of the processing program that was being processed immediately before the first interrupt request, and switches and supplies the clock only to the watchdog timer corresponding to the restarted processing program. A runaway detection method for a data processing system, comprising detecting a runaway of the data processing system based on an overflow of a watchdog timer of a program or an overflow of a watchdog timer for the first interrupt processing.
【請求項2】 前記第1の割り込み処理の処理中に、定
期的若しくは不定期的に発生する更に即時性が要求され
る第2の割り込み要求に基づいて第2の割り込み処理が
行われた時は、第2の割り込み処理用のウォッチドッグ
タイマに対してのみクロックの供給を行い、かつ、前記
第1の割り込み処理用のウォッチドッグタイマに対する
クロックは供給を停止し、該割り込み処理終了時に該第
2の割り込み処理用のウォッチドッグタイマに対してリ
セット信号を供給すると共に、前記第2の割り込み要求
直前に処理していた前記第1の割り込み処理の処理を再
開し、かつ、その再開した第1の割り込み処理に対応し
たウォッチドッグタイマのみにクロックを切替供給し、
前記第2の割り込み処理用のウォッチドッグタイマのオ
ーバーフローに基づき前記データ処理システムの暴走発
生を検出することを特徴とする請求項1記載のデータ処
理システムの暴走検出方法。
2. When the second interrupt processing is performed based on a second interrupt request that needs to be immediate and that occurs periodically or irregularly during the processing of the first interrupt processing. Supplies a clock only to a second watchdog timer for interrupt processing, and stops supplying a clock to the watchdog timer for first interrupt processing. A reset signal is supplied to the watchdog timer for interrupt processing of the second interrupt processing, the processing of the first interrupt processing which has been processed immediately before the second interrupt request is restarted, and the restarted first interrupt processing is performed. The clock is switched and supplied only to the watchdog timer corresponding to the interrupt processing of
2. The runaway detection method for a data processing system according to claim 1, wherein the runaway of the data processing system is detected based on an overflow of the watchdog timer for the second interrupt processing.
JP09079953A 1997-03-31 1997-03-31 Runaway detection method for data processing system Expired - Fee Related JP3137025B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP09079953A JP3137025B2 (en) 1997-03-31 1997-03-31 Runaway detection method for data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP09079953A JP3137025B2 (en) 1997-03-31 1997-03-31 Runaway detection method for data processing system

Publications (2)

Publication Number Publication Date
JPH10275097A JPH10275097A (en) 1998-10-13
JP3137025B2 true JP3137025B2 (en) 2001-02-19

Family

ID=13704685

Family Applications (1)

Application Number Title Priority Date Filing Date
JP09079953A Expired - Fee Related JP3137025B2 (en) 1997-03-31 1997-03-31 Runaway detection method for data processing system

Country Status (1)

Country Link
JP (1) JP3137025B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5148662B2 (en) * 2010-07-13 2013-02-20 東芝テック株式会社 Electronic device and control program thereof
US9436627B2 (en) 2011-08-25 2016-09-06 International Business Machines Corporation Detection of abnormal operation caused by interrupt processing
JP2017045303A (en) * 2015-08-27 2017-03-02 ファナック株式会社 Controller that can detect causes of abnormalities in functions of personal computer

Also Published As

Publication number Publication date
JPH10275097A (en) 1998-10-13

Similar Documents

Publication Publication Date Title
KR950005217B1 (en) Clock signal control method and data processing system
US6670839B2 (en) Clock monitoring apparatus
JP3137025B2 (en) Runaway detection method for data processing system
CA2530149C (en) Starting control method, duplex platform system, and information processor
KR20230167901A (en) Time correction method to ensure periodicity of multi-threaded programs
JP3690555B2 (en) Time management change device and external interrupt protection device
JPH064318A (en) Error detecting system
JPH033041A (en) Time-out monitoring circuit
JPH11327959A (en) Method and device for monitoring abnormality of processor
JPS62175840A (en) Multi-level watchdog timer system
JPH11345129A (en) Interval timer circuit
JPH06230988A (en) Computer
JP3700581B2 (en) Microcomputer
JPH0973404A (en) Watchdog timer circuit
JPH08305664A (en) Method and device for cpu monitoring
JP4083954B2 (en) Anomaly monitoring apparatus and anomaly monitoring method
JP2004171040A (en) Timer circuit
JP2000181755A (en) Method and device for abnormality detection, multitask system, and recording medium
JP2631541B2 (en) Programmable controller
WO2025186913A1 (en) Information processing method and electronic control device
JP3308670B2 (en) Event-driven processing equipment failure detection device
JPH01245322A (en) Power failure control circuit for microprocessor
JPS62162104A (en) Flow chart type programmable controller
JPS60110050A (en) Fault monitor system of software
US20040230319A1 (en) Microcontroller device for complex processing procedures and corresponding interrupt management process

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071208

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081208

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091208

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091208

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101208

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101208

Year of fee payment: 10

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101208

Year of fee payment: 10

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111208

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111208

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121208

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131208

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees