JPS63282858A - System for preventing program runaway - Google Patents

System for preventing program runaway

Info

Publication number
JPS63282858A
JPS63282858A JP62118210A JP11821087A JPS63282858A JP S63282858 A JPS63282858 A JP S63282858A JP 62118210 A JP62118210 A JP 62118210A JP 11821087 A JP11821087 A JP 11821087A JP S63282858 A JPS63282858 A JP S63282858A
Authority
JP
Japan
Prior art keywords
processing
microprocessor
microprogram
runaway
flag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP62118210A
Other languages
Japanese (ja)
Inventor
Seiichi Saito
成一 斉藤
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP62118210A priority Critical patent/JPS63282858A/en
Publication of JPS63282858A publication Critical patent/JPS63282858A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To prevent a microprogram from generating runaway by interrupting a microprocessor at a fixed period, reading out the state of a processing flag from processing flag register to detect whether respective processing is successively executed or not, and executing prescribed abnormality processing when the processing is not successively executed. CONSTITUTION:A processing flag is inverted every end of each processing out of processing #1, #2 and the processing flags '1', '0' are alternately changed at the time of executing the microprogram. The processing flag can be decided by checking that the contents of a register 5 storing the processing flag is alternately changed to '1' and '0' every external periodical interruption, i.e. every time when the output of a counter 2 is inputted to an INT terminal of the microprocessor 1 as an interruption. Consequently, highly reliable runaway prevention can be attained.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、マイクロプロセッサの処理動作におけるプ
ログラムの暴走防止方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for preventing program runaway in processing operations of a microprocessor.

[従来の技術〕 第3図と第4図は、従来の暴走防止方式を示すマイクロ
プログラムのフローチャートと、これを実現する構成図
を示すものである。
[Prior Art] FIGS. 3 and 4 show a flowchart of a microprogram showing a conventional runaway prevention method and a block diagram for realizing this.

第4図において、(1)はマイクロプロセッサ、(3)
はデコーダ、(4)はリセット端子対のシーケンスカウ
ンタであり、そのカウンタの出力はマイクロプロセッサ
(1)のノンマスカブル割込(以下、NMI と称す。
In Figure 4, (1) is a microprocessor, (3)
is a decoder, (4) is a sequence counter with a pair of reset terminals, and the output of the counter is a non-maskable interrupt (hereinafter referred to as NMI) of the microprocessor (1).

: Non Maskarable Interrup
t)端子に接続されている。
: Non-Maskarable Interrupt
t) connected to the terminal.

次に動作について説明する。マイクロプロセッサ(1)
の動作は、マイクロプログラムによって処理の順序が規
定され、第3図に示すように5TARTから開始され、
5TEPどなるまでそのマイクロプログラムの順序に従
って実行される。そして、このマイクロプログラム中に
rOuT XXX Jで示される部分は、第4図のデコ
ーダ(3)からカウンタリセットの出力が発生するリセ
ット処理動作を行わせるものであり、このようなリセッ
ト処理動作間rout XXX、」〜rol]T XX
X 」間の処理時間が例えば所定時間16.8ms x
 7−116.2ms以内で終了するようにマイクロプ
ログラムを作っておくことによリ、第4図のカウンタ(
4)の出力は、通常時常に出力されることなく、マイク
ロプロセッサ(1)にはNMIが発生しない。
Next, the operation will be explained. Microprocessor (1)
The processing order of the operation is defined by the microprogram, and starts from 5TART as shown in FIG.
5 TEP is executed according to the order of its microprograms. The part indicated by rOut XXX J in this microprogram is for performing a reset processing operation in which a counter reset output is generated from the decoder (3) in FIG. XXX,”~rol]T XX
For example, the processing time between
By creating a microprogram that completes within 7-116.2ms, the counter in Figure 4 (
The output of 4) is not always output under normal conditions, and no NMI occurs in the microprocessor (1).

一力、雷など各種ノイズが発生してマイクロプロセッサ
(1)の動作が一時的に不良となり、マイクロプログラ
ムの処理が異常状態(暴走状態)となることがある。こ
のような場合は、正しい処理が行われずリセット処理動
作rOUT XXX Jの動作自身が行われなくなった
り、上記のリセット処理動作量、つまりrotlT X
XX J 〜rOUT XXX J間の処理時間が所定
時間= 116.2msを越えたりすることが多い。し
たがって、デコーダ(3)の出力がカウンタ(4)のカ
ウンタ時間以内に出なくなり、カウンタ(4)の出力が
出てマイクロプロセッサ(1)に対してNMIが発生す
る。すなわち、暴走が検出され、第3図に示されるNM
I発生時の異常処理を行えば(例えば、プログラムの5
TARTに戻って初めからやり直すなど)、暴走防止を
行うことができる。
The occurrence of various types of noise such as lightning or lightning may cause the microprocessor (1) to temporarily malfunction, resulting in an abnormal state (runaway state) in the processing of the microprogram. In such a case, correct processing may not be performed and the reset processing operation rOUT XXX J itself may not be performed, or the above reset processing operation amount, that is,
The processing time between XX J and rOUT XXX J often exceeds the predetermined time = 116.2 ms. Therefore, the output of the decoder (3) does not come out within the counter time of the counter (4), and the output of the counter (4) comes out, causing an NMI to the microprocessor (1). That is, runaway is detected and the NM shown in FIG.
If you handle the abnormality when I occurs (for example, 5 of the program
(Return to TART and start over from the beginning, etc.) can prevent runaway.

なお、このような暴走防止方式を一般に、「ウォッチ・
ドッグ・タイマによる方式」と呼んでいる。
In addition, this type of runaway prevention method is generally referred to as “watch”.
This is called the dog timer method.

[発明が解決しようとする問題点] 従来の暴走防止方式は、以上のように構成されているの
で、リセット処理動作r OUT XXX Jのマイク
ロプログラム命令およびリセット処理動作量、つまりr
OUT XXX J 〜rOUT XXX J間の時間
が正しい状態のまま暴走した場合、例えば第5図に示す
ような永久ループで暴走している場合は、暴走を防止す
ることができない問題点があった。
[Problems to be Solved by the Invention] Since the conventional runaway prevention method is configured as described above, the reset processing operation r OUT XXX J microprogram instruction and reset processing operation amount, that is, r
If the time between OUT XXX J and rOUT XXX J runs out of control while being in the correct state, for example, if the runaway occurs in an endless loop as shown in FIG. 5, there is a problem that the runaway cannot be prevented.

この発明は、上記のような問題点を解消するためになさ
れたもので、雷などのノイズ発生によって一部の特定の
マイクロプログラム部分で永久ループ(暴走)を引起し
た際でも暴走を検出して暴走を防止することのできる信
顆性の高いプログラムの暴走防止方式を得ることを目的
とする。
This invention was made to solve the above-mentioned problems, and even when a certain part of the microprogram causes an endless loop (runaway) due to the occurrence of noise such as lightning, it can detect the runaway. The purpose of this invention is to obtain a highly reliable program runaway prevention method that can prevent runaways.

[問題点を解決するための手段] この発明に係るプログラムの暴走防止方式は、マイクロ
プロセッサによる各処理が終了する毎に1とOが交互に
反転するようにした処理フラグを備え、当該マイクロプ
ロセッサに対し一定周期で割込を行ってこの処理フラグ
の状態を処理フラグレジスタから読むことによって各処
理が順次行われているか否かを検出し、順次行われてい
ない時は所定の異常処理を行い、マイクロプログラムの
暴走を防止することを特徴とするものである。
[Means for Solving the Problems] The program runaway prevention method according to the present invention includes a processing flag in which 1 and O are alternately inverted each time each processing by a microprocessor is completed, It detects whether or not each process is being performed sequentially by interrupting the process at regular intervals and reading the status of this process flag from the process flag register. , which is characterized by preventing runaway of microprograms.

[作用コ この発明において、マイクロプログラムの処理フラグを
170交互に反転させるようにしたことによって各偶3
!!(処理1tl、#2)が確実に通過したことが確認
され、暴走を検出できる。
[Operations] In this invention, the processing flags of the microprogram are alternately inverted by 170, so that each even 3
! ! It is confirmed that (processing 1tl, #2) has passed reliably, and runaway can be detected.

[実施例] 以下、この発明の一実施例を図について説明する。第1
図はこの発明のマイクロプログラムのフローチャートを
示したものであり、また、第2図はこのマイクロプログ
ラムを実行させるためのマイクロプロセッサを含む回路
構成図で、(1)はマイクロプロセッサ、(2)はシー
ケンスカウンタ、(5)は各処理が終了する毎に1とO
が交互に反転するようになされた処理フラグを記憶する
処理フラグレジスタを示し、一定周期でマイクロプロセ
ッサに割込を行って処理フラグの状態を読込み各処理が
順次行われているか否かが検出できるようになされてい
る。
[Example] Hereinafter, an example of the present invention will be described with reference to the drawings. 1st
The figure shows a flowchart of the microprogram of the present invention, and FIG. 2 is a circuit configuration diagram including a microprocessor for executing this microprogram, where (1) is the microprocessor and (2) is the The sequence counter (5) changes to 1 and O every time each process ends.
indicates a processing flag register that stores processing flags that are alternately inverted.By interrupting the microprocessor at regular intervals and reading the state of the processing flags, it is possible to detect whether each process is being performed sequentially. It is done like this.

上記構成の動作について説明する。The operation of the above configuration will be explained.

第1図のマイクロプログラムの通常時の動作は、5TA
RT (開始)で、まずイニシャライズを行い状態を初
期化し、処理フラグをリセット後処理#l、処理#2の
各!A埋を5TOP指定があるまで続行する。そして、
この処理#l、処理#2の各処理が終了する毎に処理フ
ラグを反転させるようにし、マイクロプログラム実行時
にこの処理フラグの170が交互に変わるようにする。
The normal operation of the microprogram in Figure 1 is 5TA.
At RT (start), first initialize to initialize the state, reset the processing flag, and then proceed to processing #l and processing #2! Continue filling in A until 5TOP is specified. and,
The processing flag is inverted every time the processing #1 and processing #2 are completed, so that the processing flag 170 is alternately changed during execution of the microprogram.

なお、この処理フラグの判断は、外部からの定期的な割
込み(第2図におけるカウンタ(2)の出力がマイクロ
プロセッサ(1)のINT端子に割込みとして発生した
とき)がある毎にその処理フラグを記憶するレジスタ(
5)の内容が170交互となっていることを確認するこ
とによる。
The processing flag is determined every time there is a regular interrupt from the outside (when the output of the counter (2) in Figure 2 is generated as an interrupt at the INT terminal of the microprocessor (1)). A register that stores (
By confirming that the contents of 5) are 170 alternating.

一方、雷など各種ノイズが発生して第2図におけるマイ
クロプロセッサ(1)の動作が一時的に不良となり、マ
イクロプログラムの処理が異常状態(暴走状態)となる
と、第1図における処理#1の途中でハング状態となっ
たり、処理#2の途中から処理#1に飛んだり、何を行
うかわからなくなる。
On the other hand, if various types of noise such as lightning occur and the operation of the microprocessor (1) in FIG. 2 temporarily malfunctions, and the microprogram processing becomes abnormal (runaway state), processing #1 in FIG. The process may hang in the middle, jump to process #1 from the middle of process #2, or become unsure of what to do.

このような場合でも一定周期で割込みが発生し、処理フ
ラグをチェックしてこれを記憶するレジスタ(5)の内
容がI10交互となっていることを確かめることによっ
て異常を検出するためマイクロプログラムの異常状態を
最小時間で復帰させることができる。
Even in such cases, interrupts occur at regular intervals, and an abnormality can be detected by checking the processing flag and confirming that the contents of the register (5) that stores it are I10 alternating. The state can be restored in the shortest possible time.

なお、上記実施例では、処理#l、処理#2と2つの場
合について説明したが、処理の数がもっと多い場合や処
理#1、処理#2など複数の処理毎に処理フラグを持た
せる場合に対しても同様の方式を適用することができる
Note that in the above embodiment, two cases, Process #1 and Process #2, were explained, but in a case where there are more processes, or when a process flag is provided for each of multiple processes such as Process #1 and Process #2. A similar method can be applied to .

[発明の効果コ 以上のように、この発明によれば、マイクロプログラム
の各処理毎に処理フラグを170交互に変えると共にマ
イクロプロセッサの割込入力に定期的に信号を入れるこ
とによってその処理フラグをチェックするので信頼性の
高い暴走防止を行うことができる。
[Effects of the Invention] As described above, according to the present invention, the processing flag is alternately changed 170 times for each process of the microprogram, and the processing flag is changed by periodically inputting a signal to the interrupt input of the microprocessor. Since this check is performed, highly reliable runaway prevention can be performed.

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

第1図はこの発明の一実施例による暴走防止マイクロプ
ログラムのフローチャート、第2図はこの暴走防止マイ
クロプログラムを実行させるための構成図、第3図と第
4図は従来の暴走防止方式を説明するフローチャートと
その構成図、第5図は従来例の永久ループでの暴走状態
を示す説明図である。 図中、(1)はマイクロプロセッサ、(2)はシーケン
スカウンタ、(5)は処理フラグレジスタ。 なお、各図中、同一符号は同一または相当部分を示す。
FIG. 1 is a flowchart of a runaway prevention microprogram according to an embodiment of the present invention, FIG. 2 is a block diagram for executing this runaway prevention microprogram, and FIGS. 3 and 4 explain a conventional runaway prevention method. FIG. 5 is an explanatory diagram showing a runaway state in an endless loop in a conventional example. In the figure, (1) is a microprocessor, (2) is a sequence counter, and (5) is a processing flag register. In each figure, the same reference numerals indicate the same or corresponding parts.

Claims (1)

【特許請求の範囲】[Claims] マイクロプロセッサによる各処理が終了する毎に1と0
が交互に反転するようにした処理フラグを備え、当該マ
イクロプロセッサに対し一定周期で割込を行ってこの処
理フラグの状態を処理フラグレジスタから読むことによ
って各処理が順次行われているか否かを検出し、順次行
われていない時は所定の異常処理を行い、マイクロプロ
グラムの暴走を防止することを特徴とするプログラムの
暴走防止方式。
1 and 0 each time the microprocessor completes each process.
The microprocessor is provided with processing flags that are alternately inverted, and by interrupting the microprocessor at regular intervals and reading the state of the processing flags from the processing flag register, it can be determined whether each processing is being performed sequentially. A program runaway prevention method is characterized in that it detects and performs predetermined abnormality processing when executions are not performed in sequence to prevent runaway of a microprogram.
JP62118210A 1987-05-15 1987-05-15 System for preventing program runaway Pending JPS63282858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62118210A JPS63282858A (en) 1987-05-15 1987-05-15 System for preventing program runaway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62118210A JPS63282858A (en) 1987-05-15 1987-05-15 System for preventing program runaway

Publications (1)

Publication Number Publication Date
JPS63282858A true JPS63282858A (en) 1988-11-18

Family

ID=14730932

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62118210A Pending JPS63282858A (en) 1987-05-15 1987-05-15 System for preventing program runaway

Country Status (1)

Country Link
JP (1) JPS63282858A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010075769A (en) * 2010-01-15 2010-04-08 Daiichi Shokai Co Ltd Game machine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010075769A (en) * 2010-01-15 2010-04-08 Daiichi Shokai Co Ltd Game machine

Similar Documents

Publication Publication Date Title
JPS63282858A (en) System for preventing program runaway
JPS63282857A (en) System for preventing program runaway
JPS5878239A (en) Operation controlling circuit
JPH03268001A (en) Controller
JPS586971B2 (en) arithmetic processing unit
JPS59148961A (en) Monitoring system of operation of processor
JPS57137949A (en) Error recovery system of logical device
JP2695785B2 (en) Processing state display method of processing unit
JPS6052456B2 (en) Error control method
SU1191910A1 (en) Device for restoring processor operation
JPS6065346A (en) Restarting device of computer system
JPH04182842A (en) Timer monitor system
JPS63298646A (en) Resetting control circuit
JPS62226249A (en) Separating system for input/output device
JPS63313245A (en) Method for detecting runaway of microcomputer
JPS6339047A (en) Test program scheduler
JPH04295938A (en) Method for monitoring runaway of microprocessor
JPH04106639A (en) Watch dog performing method for system using cpu
JPH04358203A (en) Sequence controller
JPH01290041A (en) Interruption control circuit
JPS60252961A (en) Program trouble supervisory device of information processing device
JPH01293449A (en) Watch dog timer
JPS60183647A (en) Watchdog timer
JPH01305438A (en) Host computer
JPS5932004A (en) Programmable controller