JPH1063541A - Program hang-up monitor device for computer system - Google Patents

Program hang-up monitor device for computer system

Info

Publication number
JPH1063541A
JPH1063541A JP8217359A JP21735996A JPH1063541A JP H1063541 A JPH1063541 A JP H1063541A JP 8217359 A JP8217359 A JP 8217359A JP 21735996 A JP21735996 A JP 21735996A JP H1063541 A JPH1063541 A JP H1063541A
Authority
JP
Japan
Prior art keywords
address
branch
program
branch destination
instruction
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
JP8217359A
Other languages
Japanese (ja)
Inventor
Masa Usami
雅 宇佐美
Shuichi Ito
秀一 伊藤
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.)
Motorola Solutions Japan Ltd
Original Assignee
Nippon Motorola Ltd
Motorola Japan Ltd
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 Nippon Motorola Ltd, Motorola Japan Ltd filed Critical Nippon Motorola Ltd
Priority to JP8217359A priority Critical patent/JPH1063541A/en
Publication of JPH1063541A publication Critical patent/JPH1063541A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To detect a program runaway without applying any heavy load to a CPU by comparing the address specified with the output value of a program counter with a stored branch destination address in response to a branch detection signal. SOLUTION: The output value of an address incrementor 21 is equal to the count value of a program counter 11a unless a CPU 11 jumps an execution address. A branch detecting circuit 22 compares the output value of the address incrementor 21 with the address data value of an address bus 12 and generates a branch detection signal unless they match each other. A branch destination address comparing circuit 23 compares the branch destination address from a branch memory 15 that a branch register 20 holds with the address that address data supplied from the address bus 12 indicates. When the comparison result of the branch destination address comparing circuit 23 indicates a discrepancy, a hang-up detection signal is generated.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータシス
テムにおけるプログラム暴走監視装置に関する。
The present invention relates to a program runaway monitoring device in a computer system.

【0002】[0002]

【従来の技術】コンピュータシステムにおいては、CP
U(中央処理装置)の動作が外乱ノイズ等の影響により
プログラムの実行順に従った正常な動作から逸脱してい
わゆるプログラム暴走することがある。このプログラム
暴走を監視するために実際のプログラム処理中において
一定時間毎に特定の処理がCPUにて実行されるように
しておき、その特定の処理の実行結果からコンピュータ
の正常動作が確認されていた。
2. Description of the Related Art In computer systems, CP
The operation of the U (central processing unit) may deviate from a normal operation in accordance with the execution order of the program due to the influence of disturbance noise or the like, causing a so-called program runaway. In order to monitor this program runaway, a specific process is executed by the CPU at regular intervals during the actual program processing, and the normal operation of the computer has been confirmed from the execution result of the specific process. .

【0003】[0003]

【発明が解決しようとする課題】しかしながら、そのよ
うな従来のプログラム暴走監視においては、かかる特定
の処理を実行する間隔である一定時間を長く設定すれ
ば、特定の処理によるCPUに課せられる負荷は少なく
て済むが、CPUがプログラム暴走した場合にそのプロ
グラム暴走が生じてから検出するまでの誤動作期間が長
くなり、その誤動作期間に例えば、RAM(ランダムア
クセスメモリ)の記憶データが不適切に書き換えられる
等のコンピュータシステムが受ける悪影響が甚大であ
る。一方、一定時間を短く設定すれば、誤動作期間が短
くなるが、特定の処理によるCPUに課せられる負荷は
大きくなるという問題がある。
However, in such a conventional program runaway monitoring, if a certain period of time, which is an interval for executing such a specific process, is set to be long, the load imposed on the CPU by the specific process is reduced. Although less is required, when the CPU goes out of control, the malfunctioning period from the occurrence of the program runaway to the detection of the program becomes longer. The adverse effects on the computer system are enormous. On the other hand, if the fixed time is set short, the malfunction period is shortened, but there is a problem that the load imposed on the CPU by the specific processing increases.

【0004】そこで、本発明の目的は、CPUの大きな
負荷となることなくプログラム暴走を適切に検出するこ
とができるコンピュータシステムのプログラム暴走監視
装置を提供することにある。
An object of the present invention is to provide a program runaway monitoring device for a computer system which can appropriately detect program runaway without causing a large load on the CPU.

【0005】[0005]

【課題を解決するための手段】本発明のコンピュータシ
ステムのプログラム暴走監視装置は、少なくとも1つの
分岐命令を含む複数の命令からなるプログラムが記憶さ
れたプログラムメモリの記憶位置をプログラムカウンタ
の出力値によってアドレス指定し、その指定された前記
プログラムメモリの記憶位置に記憶されたプログラムの
命令を読み出して実行するコンピュータシステムのプロ
グラム暴走監視装置であって、プログラムの分岐命令に
よって分岐した直後に実行すべき命令が記憶されたプロ
グラムメモリの記憶位置を示す分岐先アドレスを記憶し
た分岐先記憶手段と、プログラムカウンタの出力値が不
連続に変化したことを検知して分岐検知信号を発生する
分岐検知手段と、分岐検知信号に応答してプログラムカ
ウンタの出力値によって指定されるアドレスと分岐先記
憶手段に記憶された分岐先アドレスとを比較してその比
較結果が不一致であるならば暴走検出信号を発生する比
較手段とを備えたことを特徴としている。
According to the present invention, there is provided a program runaway monitoring apparatus for a computer system, wherein a storage location of a program memory storing a program including a plurality of instructions including at least one branch instruction is determined by an output value of a program counter. A program runaway monitoring device for a computer system, which designates an address and reads and executes a program instruction stored in a storage location of the specified program memory, wherein an instruction to be executed immediately after branching by a program branch instruction Branch destination storage means for storing a branch destination address indicating the storage location of the program memory in which is stored, and branch detection means for generating a branch detection signal by detecting that the output value of the program counter has changed discontinuously, Change the output value of the program counter in response to the branch detection signal As a comparison result by comparing the stored branch destination address to the address and the branch destination storage unit specified is characterized in that a comparison means for generating a runaway detection signal if a mismatch I.

【0006】[0006]

【発明の実施の形態】以下、本発明の実施例を図面を参
照しつつ詳細に説明する。図1は本発明によるプログラ
ム暴走監視装置を備えたコンピュータシステムを概略的
に示している。このコンピュータシステムにおいて、C
PU(中央処理装置)11の内蔵のプログラムカウンタ
(PC)11aの出力から延びたアドレスバス12には
RAM(ランダムアクセスメモリ)13、ROM(リー
ドオンリメモリ)14、分岐先メモリ15及び暴走監視
回路16が接続されている。また、CPU(中央処理装
置)11から延びたデータバス17にはRAM13及び
ROM14が接続されている。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 schematically shows a computer system provided with a program runaway monitoring device according to the present invention. In this computer system, C
An address bus 12 extending from an output of a built-in program counter (PC) 11a of a PU (central processing unit) 11 has a RAM (random access memory) 13, a ROM (read only memory) 14, a branch destination memory 15, and a runaway monitoring circuit. 16 are connected. A RAM 13 and a ROM 14 are connected to a data bus 17 extending from a CPU (Central Processing Unit) 11.

【0007】ROM14にはCPU11が実行するプロ
グラムが予め記憶され、CPU11は内蔵のプログラム
カウンタ11aの値で指定されるROM14のアドレス
から命令を読み出してその命令を実行する。分岐先メモ
リ15は例えば、リードオンリメモリからなり、ROM
14の各アドレスに対応した記憶位置を有している。す
なわち、分岐先メモリ15にはROM14と同一のアド
レスが割り当てられててる。更に、分岐先メモリ15に
はROM14に記憶されたプログラム中の強制ジャンプ
命令や条件ジャンプ命令等の分岐命令の分岐先アドレス
だけが予め記憶されている。プログラム中の最初のアド
レスから最初の分岐命令のアドレスまでの分岐先メモリ
15の記憶位置にはその最初の分岐命令の分岐先アドレ
スが記憶される。またプログラム中の1つの分岐命令の
アドレスの次のアドレスから次の分岐命令のアドレスま
での分岐先メモリ15の記憶位置には次の分岐命令の分
岐先アドレスが記憶される。分岐先メモリ15はアドレ
スバス12から供給されるアドレスデータが示すアドレ
スに記憶された分岐先アドレスをデータ値として出力す
る。
A program to be executed by the CPU 11 is stored in the ROM 14 in advance. The CPU 11 reads an instruction from an address of the ROM 14 designated by a value of a built-in program counter 11a and executes the instruction. The branch destination memory 15 is composed of, for example, a read-only memory,
There are 14 storage locations corresponding to each address. That is, the same address as the ROM 14 is assigned to the branch destination memory 15. Further, the branch destination memory 15 stores in advance only the branch destination addresses of the branch instructions such as the forced jump instruction and the conditional jump instruction in the program stored in the ROM 14. The storage location of the branch destination memory 15 from the first address in the program to the address of the first branch instruction stores the branch destination address of the first branch instruction. The branch destination address of the next branch instruction is stored in the storage location of the branch destination memory 15 from the address following the address of one branch instruction to the address of the next branch instruction in the program. The branch destination memory 15 outputs the branch destination address stored at the address indicated by the address data supplied from the address bus 12 as a data value.

【0008】なお、分岐先メモリ15としてはRAMを
用いることもできる。その場合にはシステム起動時に必
要な分岐先アドレスがそのRAMに書き込まれるように
すれば良いである。暴走監視回路16は図2に示すよう
に、分岐先レジスタ20と、アドレスバス12に各々接
続されたアドレスインクリメンタ21、分岐検知回路2
2及び分岐先アドレス比較回路23とを有している。分
岐先レジスタ20は分岐先メモリ15から読み出された
分岐先アドレスを保持する。この分岐先アドレスは次の
命令がCPU11において設置されるまで(分岐した場
合には分岐先アドレスがCPU11のプログラムカウン
タ11aから出力されるまで)保持されて出力される。
アドレスインクリメンタ21はプログラマブルカウンタ
からなり、CPU11から供給される動作情報信号の内
容に応じてアドレスバス12からアドレスデータを入力
してそれを計数初期値とし、クロックパルスの発生タイ
ミングで1ずつカウントアップする。よって、アドレス
インクリメンタ21の出力値はCPU11が分岐命令で
実行アドレスをジャンプしない限りはプログラムカウン
タ11aの計数値と同一である。分岐検知回路22はア
ドレスインクリメンタ21の出力に接続され、アドレス
インクリメンタ21の出力値とアドレスバス12のアド
レスデータ値とを比較し、その比較結果が不一致のとき
分岐検知信号を発生する。分岐先アドレス比較回路23
は分岐検知回路22の出力に接続され、分岐検知回路2
2から分岐検知信号が供給されるようになっている。更
に、分岐先アドレス比較回路23は、分岐検知回路22
から分岐検知信号が供給されたときには、分岐レジスタ
20が保持出力している分岐先アドレスとアドレスバス
12から供給されるアドレスデータが示すアドレスとを
比較する。分岐先アドレス比較回路23の比較結果が暴
走監視出力信号としてCPU11に出力される。
Note that a RAM can be used as the branch destination memory 15. In such a case, the necessary branch destination address may be written into the RAM when the system is started. As shown in FIG. 2, runaway monitor circuit 16 includes branch destination register 20, address incrementer 21 connected to address bus 12, and branch detection circuit 2.
2 and a branch destination address comparison circuit 23. The branch destination register 20 holds the branch destination address read from the branch destination memory 15. This branch destination address is held and output until the next instruction is set in the CPU 11 (or in the case of a branch, the branch destination address is output from the program counter 11a of the CPU 11).
The address incrementer 21 is composed of a programmable counter, inputs address data from the address bus 12 in accordance with the contents of the operation information signal supplied from the CPU 11, sets it as an initial count value, and counts up one by one at a clock pulse generation timing. I do. Therefore, the output value of the address incrementer 21 is the same as the count value of the program counter 11a unless the CPU 11 jumps the execution address with a branch instruction. The branch detection circuit 22 is connected to the output of the address incrementer 21, compares the output value of the address incrementer 21 with the address data value of the address bus 12, and generates a branch detection signal when the comparison result does not match. Branch destination address comparison circuit 23
Is connected to the output of the branch detection circuit 22, and the branch detection circuit 2
2 supplies a branch detection signal. Further, the branch destination address comparison circuit 23
When the branch detection signal is supplied from the branch register 20, the branch destination address held and output by the branch register 20 is compared with the address indicated by the address data supplied from the address bus 12. The comparison result of the branch destination address comparison circuit 23 is output to the CPU 11 as a runaway monitoring output signal.

【0009】図3はROM14にアドレス順に記憶され
たプログラムの命令を部分的に示している。ここで、一
般命令とは分岐を伴わない命令であり、例えば、演算命
令、データ移動命令及び制御命令である。分岐命令は無
条件に分岐する強制ジャンプ命令、或いは所定の条件を
満足すれば分岐しその条件を満足しなれば分岐しない条
件ジャンプ命令のように分岐先アドレスを有する命令で
ある。各分岐命令には分岐先アドレスが($AA)のよ
うに付加されている。なお、「$」はそれに続く値がア
ドレスであることを示し、また、分かり易くするために
16進数で2桁のアドレスとしている。
FIG. 3 partially shows program instructions stored in the ROM 14 in the order of addresses. Here, the general instruction is an instruction that does not involve branching, and is, for example, an operation instruction, a data movement instruction, and a control instruction. A branch instruction is an instruction having a branch destination address, such as a forced jump instruction that branches unconditionally or a conditional jump instruction that branches if a predetermined condition is satisfied and does not branch if the condition is not satisfied. A branch destination address is added to each branch instruction as (@AA). Note that "@" indicates that the value following it is an address, and for clarity, it is a two-digit hexadecimal address.

【0010】図4は図3に示したプログラムに対応した
分岐先メモリ15の記憶内容をアドレス順に部分的に示
している。すなわち、図3のプログラムから分かるよう
に、ROM14のアドレス$04には分岐命令($A
A)が記憶されているので、分岐先メモリ15のアドレ
ス$00から$04までの各記憶位置にはアドレス$A
Aが記憶されている。ROM14においてアドレス$0
4の次に分岐命令が存在するのはアドレス$1Aであ
り、そのアドレス$1Aには分岐命令($BB)が記憶
されているので、分岐先メモリ15のアドレス$05〜
$1Aの各記憶位置にはアドレス$BBが記憶されてい
る。また同様に、ROM14においてアドレス$1Aの
次に分岐命令が存在するのはアドレス$23であり、そ
のアドレス$23Aには分岐命令($CC)が記憶され
ているので、分岐先メモリ15のアドレス$1B〜$2
3の各記憶位置にはアドレス$CCが記憶されている。
このようにプログラム中の1つの分岐命令のアドレスの
次のアドレスから次の分岐命令のアドレスまでの分岐先
メモリ15の各記憶位置には次の分岐命令の分岐先アド
レスが記憶される。
FIG. 4 partially shows the storage contents of the branch destination memory 15 corresponding to the program shown in FIG. 3 in the order of addresses. That is, as can be seen from the program of FIG. 3, the branch instruction ($ A
A) is stored, the address $ A is stored in each storage location from the address $ 00 to the address $ 04 of the branch destination memory 15.
A is stored. In the ROM 14, the address $ 0
4, the branch instruction exists at address $ 1A. Since the branch instruction ($ BB) is stored at address $ 1A, addresses $ 05 to $ 5 of branch destination memory 15 are stored.
An address $ BB is stored in each storage location of $ 1A. Similarly, in the ROM 14, the branch instruction next to the address $ 1A exists at the address $ 23. Since the branch instruction ($ CC) is stored in the address $ 23A, the address of the branch destination memory 15 is stored. $ 1B to $ 2
The address $ CC is stored in each storage location of No. 3.
As described above, the branch destination address of the next branch instruction is stored in each storage location of the branch destination memory 15 from the address next to the address of one branch instruction in the program to the address of the next branch instruction.

【0011】次に、CPU11が図3に示したプログラ
ムに従って動作する場合の暴走監視回路16の動作のに
ついて説明する。CPU11がプログラムのアドレス$
00の命令から実行を開始する場合、CPU11のプロ
グラムカウンタ11aによるクロックパルスに同期した
計数動作によってアドレス$00から順番にアドレスが
指定される。その指定アドレスを示すアドレスデータが
アドレスバス12を介してROM14及び分岐先メモリ
15に供給される。ROM14からは指定アドレスの記
憶位置の命令が読み出されてデータバス17を介してC
PU11に供給され、CPU11はROM14から命令
が供給される毎にその命令を解読して実行する。その命
令が分岐命令であるならば、その実行結果に応じて分岐
先アドレスに分岐するか否かが判別される。分岐しない
場合には、プログラムカウンタ11aの値は次のクロッ
クパルスに応答してそのままカウントアップされる。分
岐する場合には、プログラムカウンタ11aに分岐先ア
ドレスがセットされ、その分岐先アドレスを示すアドレ
スデータがアドレスバス12を介してROM14及び分
岐先メモリ15に供給される。ROM14からはその分
岐先アドレスの記憶位置の命令が読み出されてデータバ
ス17を介してCPU11に供給され、CPU11が命
令を解読して実行することにより、上記の動作を繰り返
すことになる。
Next, the operation of runaway monitor circuit 16 when CPU 11 operates according to the program shown in FIG. 3 will be described. The CPU 11 determines the address of the program.
When execution is started from the instruction of 00, addresses are sequentially specified from address $ 00 by a counting operation synchronized with a clock pulse by the program counter 11a of the CPU 11. Address data indicating the designated address is supplied to the ROM 14 and the branch destination memory 15 via the address bus 12. The instruction at the storage location of the designated address is read from the ROM 14 and
The instruction is supplied to the PU 11, and the CPU 11 decodes and executes the instruction every time the instruction is supplied from the ROM 14. If the instruction is a branch instruction, it is determined whether or not to branch to a branch destination address according to the execution result. If the branch is not taken, the value of the program counter 11a is counted up in response to the next clock pulse. When branching, the branch destination address is set in the program counter 11a, and address data indicating the branch destination address is supplied to the ROM 14 and the branch destination memory 15 via the address bus 12. The instruction at the storage location of the branch destination address is read from the ROM 14 and supplied to the CPU 11 via the data bus 17, and the CPU 11 decodes and executes the instruction, thereby repeating the above operation.

【0012】アドレスデータがアドレスバス12を介し
てROM14及び分岐先メモリ15に供給されると、上
記のようにROM14からは命令が読み出される一方、
分岐先メモリ15においてはアドレスデータで指定され
る記憶位置に記憶された分岐先アドレスが読み出されて
分岐レジスタ20に保持される。分岐レジスタ20に保
持された分岐先アドレスはプログラムカウンタ11aの
出力値が$00のときには直ちに分岐先アドレス比較回
路23に出力されるが、それ以降は上記したように次の
命令がCPU11において設置されるまで保持されて分
岐先アドレス比較回路23に供給される。
When the address data is supplied to the ROM 14 and the branch destination memory 15 via the address bus 12, the instruction is read from the ROM 14 as described above,
In the branch destination memory 15, the branch destination address stored in the storage location specified by the address data is read and held in the branch register 20. The branch destination address held in the branch register 20 is immediately output to the branch destination address comparison circuit 23 when the output value of the program counter 11a is $ 00, but thereafter the next instruction is installed in the CPU 11 as described above. And is supplied to the branch destination address comparison circuit 23.

【0013】アドレスインクリメンタ21においては、
CPU11から供給される動作情報信号の内容に応じて
アドレスバス12からプログラムカウンタ11aの値で
あるアドレスデータが入力された後には、そのアドレス
データ値を初期値としてクロックパルスに同期してアッ
プ計数(インクリメント)を行なって出力するので、プ
ログラムカウンタ11aに分岐先アドレスがセットされ
ない限りにおいてはプログラムカウンタ11aの計数値
と同一の値が分岐検知回路22に出力される。よって、
プログラムカウンタ11aに分岐先アドレスがセットさ
れない限りにおいては分岐検知回路22はアドレスイン
クリメンタ21の出力値とアドレスバス12からのアド
レスデータ値とが一致するので分岐検知信号を発生しな
い。
In the address incrementer 21,
After the address data, which is the value of the program counter 11a, is input from the address bus 12 according to the contents of the operation information signal supplied from the CPU 11, the address data value is used as an initial value to count up in synchronization with a clock pulse ( As a result, the same value as the count value of the program counter 11a is output to the branch detection circuit 22 unless the branch destination address is set in the program counter 11a. Therefore,
As long as the branch destination address is not set in the program counter 11a, the branch detection circuit 22 does not generate a branch detection signal because the output value of the address incrementer 21 matches the address data value from the address bus 12.

【0014】上記したように分岐動作が行われたためプ
ログラムカウンタ11aに分岐先アドレスがセットされ
た場合には、CPU11からアドレスインクリメンタ2
1に供給される動作情報信号の内容は直ちに変化せず、
アドレスインクリメンタ21の出力値は単にアップ計数
された値であるので、アドレスインクリメンタ21の出
力値とアドレスバス12からのアドレスデータ値とが一
致しない。これにより分岐検知回路22は分岐検知信号
を発生する。
When the branch destination address is set in the program counter 11a because the branch operation has been performed as described above, the CPU 11 sends the address incrementer 2
The content of the operation information signal supplied to 1 does not change immediately,
Since the output value of the address incrementer 21 is simply a value counted up, the output value of the address incrementer 21 does not match the address data value from the address bus 12. Thereby, the branch detection circuit 22 generates a branch detection signal.

【0015】分岐検知信号は分岐先アドレス比較回路2
3に供給されるので、この分岐検知信号に応答して分岐
先アドレス比較回路23は分岐レジスタ20から出力さ
れている分岐先アドレスとアドレスバス12から供給さ
れるアドレスデータが示す現アドレスとを比較する。分
岐先アドレスと現アドレスとが一致するならば、プログ
ラムカウンタ11aが示す実際に分岐した先のアドレス
が予め定められた分岐先アドレスと一致するので、分岐
動作は正しく行われたことなる。よって、分岐先アドレ
ス比較回路23は正常を示す暴走監視出力信号を出力す
る。
The branch detection signal is transmitted to the branch destination address comparison circuit 2
3, the branch destination address comparison circuit 23 compares the branch destination address output from the branch register 20 with the current address indicated by the address data supplied from the address bus 12 in response to the branch detection signal. I do. If the branch destination address matches the current address, the actual branch destination address indicated by the program counter 11a matches the predetermined branch destination address, indicating that the branch operation has been performed correctly. Therefore, the branch destination address comparison circuit 23 outputs a runaway monitoring output signal indicating normal.

【0016】一方、プログラムカウンタ11aの出力値
が通常のカウントアップ動作をすることなくプログラム
暴走により変化した場合には、上記の分岐動作の場合と
同様にアドレスインクリメンタ21の出力値とアドレス
バス12からのアドレスデータ値とが一致しなくなるの
で、分岐検知回路22は分岐検知信号を発生する。しか
しながら、プログラム暴走により変化したプログラムカ
ウンタ11aの出力値は分岐レジスタ20が出力してい
る分岐先アドレスとは一致することは通常ないので、分
岐先アドレス比較回路23は異常を示す暴走監視出力信
号を暴走検出信号として出力する。この異常を示す暴走
監視出力信号はリセット信号としてCPU11に供給さ
れ、CPU11の動作を初期状態にさせることになる。
On the other hand, when the output value of the program counter 11a changes due to program runaway without performing a normal count-up operation, the output value of the address incrementer 21 and the address bus 12 are changed in the same manner as in the branch operation described above. The branch detection circuit 22 generates a branch detection signal because the address data value no longer matches the address data. However, since the output value of the program counter 11a changed by the program runaway usually does not coincide with the branch destination address output from the branch register 20, the branch destination address comparison circuit 23 outputs a runaway monitoring output signal indicating an abnormality. Output as runaway detection signal. The runaway monitoring output signal indicating this abnormality is supplied to the CPU 11 as a reset signal, and the operation of the CPU 11 is initialized.

【0017】図5は図3に示したプログラムの実行によ
る命令の進行具合並びにプログラムカウンタ11aによ
り指定されるアドレス及び分岐レジスタ20から出力さ
れるアドレスの各変化を示している。ここで、命令の進
行は二重線で示したように、図3に示したプログラム中
のアドレス$04及び$1Aの分岐命令に対してCPU
11は分岐せずそのまま次のアドレスの命令を実行し、
アドレス$23の分岐命令に対しては分岐して分岐先ア
ドレス$CCの命令を実行するものとする。
FIG. 5 shows the progress of the instruction by the execution of the program shown in FIG. 3, and changes in the address specified by the program counter 11a and the address output from the branch register 20. Here, as indicated by a double line, the progress of the instruction corresponds to the branch instruction at addresses $ 04 and $ 1A in the program shown in FIG.
11 executes the instruction at the next address without branching,
It is assumed that the branch instruction at address $ 23 is branched and the instruction at branch destination address $ CC is executed.

【0018】すなわち、プログラム中のアドレス$04
の分岐命令($AA)が実行され、分岐命令($AA)
の実行より分岐せずそのまま次のアドレス$05の命令
が実行される。アドレス$05が実行されるまでは分岐
レジスタ20から出力されるアドレスは$AAである。
アドレス$05の次のアドレス$06が指定されると、
分岐レジスタ20から出力されるアドレスは$BBとな
る。その後、アドレス$1Aの分岐命令($BB)が実
行され、更にアドレス$1Bが実行されるまでは分岐レ
ジスタ20から出力されるアドレスは$BBである。分
岐命令($BB)の実行より分岐せずそのまま次のアド
レス$1Bの命令が実行される。そして、アドレス$1
Bの次のアドレス$1Cが指定されると、分岐レジスタ
20から出力されるアドレスは$CCとなる。その後、
アドレス$23の分岐命令($CC)が実行され、分岐
命令($CC)実行より分岐することになりその分岐先
アドレス$CCにプログラムカウンタ11aがセットさ
れると、分岐検知信号が発生する。この分岐検知信号の
発生により分岐先アドレス比較回路23の比較動作が行
なわれる。分岐レジスタ20から出力されるアドレスと
現アドレスとは共に$CCで一致するので分岐先アドレ
ス比較回路23の出力信号からは正常と判断される。
That is, the address $ 04 in the program
Is executed, and the branch instruction ($ AA) is executed.
, The instruction at the next address $ 05 is executed without branching. Until the address $ 05 is executed, the address output from the branch register 20 is $ AA.
When the address $ 06 following the address $ 05 is designated,
The address output from branch register 20 is $ BB. Thereafter, the branch instruction ($ BB) at address # 1A is executed, and the address output from branch register 20 is $ BB until address # 1B is further executed. The instruction at the next address # 1B is executed without branching from the execution of the branch instruction ($ BB). And address $ 1
When the address $ 1C next to B is specified, the address output from the branch register 20 becomes $ CC. afterwards,
The branch instruction ($ CC) at address # 23 is executed, and the branch is executed by execution of the branch instruction ($ CC). When the program counter 11a is set at the branch destination address $ CC, a branch detection signal is generated. By the generation of the branch detection signal, the comparison operation of the branch destination address comparison circuit 23 is performed. Since both the address output from the branch register 20 and the current address match at $ CC, it is determined from the output signal of the branch destination address comparison circuit 23 that it is normal.

【0019】この図5のプログラム実行進行状態におい
てプログラムカウンタ11aが示すアドレスが$20か
らプログラム暴走により矢印で示したように$EFに移
動してしまった場合には、分岐検知信号が発生するの
で、分岐先アドレス比較回路23の比較動作が行なわれ
る。しかしながら、このときの分岐レジスタ20の保持
出力アドレスは$CCであるので、現アドレス$EFと
一致しない。よって、分岐先アドレス比較回路23の出
力信号からは異常と判断される。
If the address indicated by the program counter 11a moves from $ 20 to $ EF due to program runaway as shown by an arrow in the program execution progress state of FIG. 5, a branch detection signal is generated. , The comparison operation of the branch destination address comparison circuit 23 is performed. However, since the output address held in the branch register 20 at this time is $ CC, it does not match the current address $ EF. Therefore, the output signal of the branch destination address comparison circuit 23 is determined to be abnormal.

【0020】なお、上記した実施例においては、アドレ
スインクリメンタ21のアドレスバス12からのアドレ
スデータ取込はCPU11からの動作情報信号の内容か
ら行なわれているが、分岐検知回路22から出力される
分岐検知信号に応答して行なっても良い。また、アドレ
スインクリメンタ21は、CPU11がRAM13につ
いてデータの読書中、割り込みによるアドレスの変更
時、或いは、割り込み処理又はサブルーチンの処理から
通常の処理に戻る場合等の動作時にはカウントアップを
停止する。このカウントアップの停止は動作情報信号に
応じて行なわれる。更に、カウントアップの停止時には
動作情報信号に応じて分岐先アドレス比較回路23の比
較動作も停止される。
In the above-described embodiment, the address data is taken in from the address bus 12 by the address incrementer 21 based on the contents of the operation information signal from the CPU 11, but is output from the branch detection circuit 22. This may be performed in response to a branch detection signal. In addition, the address incrementer 21 stops counting when the CPU 11 is reading data from the RAM 13, when changing the address due to an interrupt, or when returning to normal processing from interrupt processing or subroutine processing. The counting up is stopped in response to the operation information signal. Further, when the counting up is stopped, the comparison operation of the branch destination address comparison circuit 23 is also stopped according to the operation information signal.

【0021】また、上記した実施例においては、異常を
示す暴走監視出力信号が出力された場合にはCPU11
のみがリセットされるが、これに限らず、システム全体
をリセットしても良いし、リセットすることなく所定の
暴走検出時の処理を行ってからプログラム処理に戻って
も良い。更に、異常箇所を解析するためにシステムの動
作状況を例えば、プリンタ出力又は外部メモリに記録し
てからリセットするようにしても良い。また、マルチプ
ルコンピュータシステムの場合には異常が検出されたシ
ステムから出力されたデータ等の結果をその後の処理に
おける判断の材料から排除することも可能である。
In the above embodiment, when a runaway monitoring output signal indicating an abnormality is output, the CPU 11
Only the reset is performed. However, the present invention is not limited to this. The entire system may be reset, or the process may be returned to the program process after performing a predetermined runaway detection process without resetting. Further, the operation state of the system may be reset, for example, by recording the operation state of the system in a printer output or an external memory in order to analyze the abnormal part. Further, in the case of a multiple computer system, it is also possible to exclude a result such as data output from a system in which an abnormality is detected from a material for determination in subsequent processing.

【0022】更に、上記した実施例において、暴走監視
回路16はCPU11の電源18及びグランドとは各々
分離された電源19及びグランドを有している。これは
同一の電源又はグランドの異常がCPU11及び暴走監
視回路16の双方に同時に影響を与えることを回避する
ためである。また、上記した実施例において、分岐先メ
モリ15はROM14の全てのアドレスに対応した記憶
位置を有し、その各記憶位置に分岐先アドレスが記憶さ
れているが、ROM14に記憶されたプログラムにおい
て分岐命令が位置するアドレスが実行されるまでは分岐
先メモリ15の1つの記憶位置から同一の分岐先アドレ
スが読み出されるようにすることも例えば、ロジック回
路を用いれば容易にできる。このように分岐先メモリ1
5にて必要な数の分岐先アドレスだけを記憶配置するこ
とにより、分岐先メモリ15の記憶容量は小さくて良い
ことになる。
Further, in the above-described embodiment, the runaway monitoring circuit 16 has a power supply 19 and a ground separated from the power supply 18 and the ground of the CPU 11, respectively. This is to prevent the same power supply or ground abnormality from affecting both the CPU 11 and the runaway monitoring circuit 16 at the same time. In the above-described embodiment, the branch destination memory 15 has storage locations corresponding to all the addresses of the ROM 14, and the branch destination address is stored in each storage location. Until the address at which the instruction is located is executed, the same branch destination address can be easily read from one storage location of the branch destination memory 15 by using, for example, a logic circuit. Thus, the branch destination memory 1
By storing and storing only the necessary number of branch destination addresses at 5, the storage capacity of the branch destination memory 15 can be small.

【0023】また、上記した実施例における分岐検知回
路22はアドレスインクリメンタ21の出力値とアドレ
スバス12に供給されているアドレスデータ値とを比較
しているが、アドレスバス12に供給されているアドレ
スデータ値が不連続に変化したことを単に検出したとき
分岐検知信号を発生しても良い。なお、プログラム中の
一般命令だけが実行されているときのプログラムカウン
タ11aの出力値の変化が連続であり、そのような連続
変化をしない場合が不連続である。また、実施例におい
ては、プログラムカウンタ11aの出力値は1ずつ変化
するように示したが、これに限らず、所定値ずつ例え
ば、2ずつ変化しても良い。
The branch detection circuit 22 in the above embodiment compares the output value of the address incrementer 21 with the address data value supplied to the address bus 12, but is supplied to the address bus 12. A branch detection signal may be generated only when it is detected that the address data value has changed discontinuously. The output value of the program counter 11a changes continuously when only the general instruction in the program is executed, and the case where such a continuous change does not occur is discontinuous. Further, in the embodiment, the output value of the program counter 11a is shown to change by one. However, the present invention is not limited to this, and may change by a predetermined value, for example, by two.

【0024】更に、本発明のプログラム暴走監視装置を
CPUにプログラム暴走の特定の処理を一定時間毎に行
なわせる従来の暴走検出方法と組み合わせても良い。こ
のように組み合わせることにより、暴走検出精度を向上
させることができる。例えば、図6に示すように、RO
Mに割り当てられたアドレス中にEEPROM(電気的
消去が可能なプログラマブルROM)を書込/消去する
サブルーチンが位置しているとすると、符号Aで示す例
では正常動作から分岐しない暴走が生じて少なくとも一
定時間以上の時間経過してから実行位置がサブルーチン
に達し、そのサブルーチンが実行されてEEPROMの
データが破壊される場合である。また符号Bで示す例で
は正常動作から分岐による暴走が生じて実行位置が直ち
にサブルーチンに達し、そのサブルーチンが実行されて
EEPROMのデータが破壊される場合である。例Aの
場合には一定時間毎に特定の処理が行なわれる従来の暴
走検出方法が有効と考えられる。一方、例Bの場合には
従来の暴走検出方法では暴走検出が難しく本発明のプロ
グラム暴走監視装置を用いることが有効と考えらる。よ
って、本発明のプログラム暴走監視装置と従来の暴走検
出方法と組み合わせて備えれば、上記の例A,Bの双方
の場合に対応することができる。
Further, the program runaway monitoring device of the present invention may be combined with a conventional runaway detection method in which the CPU performs a specific process of the program runaway at regular time intervals. With such a combination, runaway detection accuracy can be improved. For example, as shown in FIG.
Assuming that a subroutine for writing / erasing an EEPROM (programmable ROM capable of electrically erasing) is located in the address assigned to M, in the example shown by the symbol A, a runaway that does not branch from normal operation occurs and at least This is a case where the execution position reaches the subroutine after a lapse of a predetermined time or more, and the subroutine is executed and the data in the EEPROM is destroyed. In the example indicated by reference character B, runaway due to branching from normal operation occurs, the execution position immediately reaches a subroutine, and the subroutine is executed to destroy data in the EEPROM. In the case of Example A, a conventional runaway detection method in which a specific process is performed at regular intervals is considered to be effective. On the other hand, in the case of Example B, it is difficult to detect runaway with the conventional runaway detection method, and it is considered effective to use the program runaway monitoring device of the present invention. Therefore, if the program runaway monitoring device of the present invention is provided in combination with the conventional runaway detection method, both cases A and B described above can be dealt with.

【0025】[0025]

【発明の効果】以上説明したように、本発明によれば、
プログラムの分岐命令によって分岐した直後に実行すべ
き命令が記憶されたプログラムメモリの記憶位置を示す
分岐先アドレスを記憶した分岐先メモリが備えられ、プ
ログラムカウンタの出力値が不連続に変化したことを検
知したときプログラムカウンタの出力値によって指定さ
れるアドレスと分岐先メモリに記憶された分岐先アドレ
スとを比較し、その比較結果が不一致であるならば暴走
検出信号を発生するので、CPUが暴走検出のために特
定の処理を実行することなくプログラム暴走を適切に検
出することができる。
As described above, according to the present invention,
A branch destination memory is provided which stores a branch destination address indicating a storage location of a program memory in which an instruction to be executed is stored immediately after branching by a branch instruction of a program, and that the output value of the program counter changes discontinuously. When detected, the CPU compares the address specified by the output value of the program counter with the branch destination address stored in the branch destination memory, and generates a runaway detection signal if the comparison result does not match. Therefore, it is possible to appropriately detect program runaway without executing a specific process.

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

【図1】本発明のプログラム暴走監視装置を適用したコ
ンピュータシステムを示すブロック図である。
FIG. 1 is a block diagram showing a computer system to which a program runaway monitoring device according to the present invention is applied.

【図2】暴走監視回路の構成を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration of a runaway monitoring circuit.

【図3】ROM内のアドレス毎の命令を示す図である。FIG. 3 is a diagram showing an instruction for each address in a ROM.

【図4】分岐先メモリのアドレス毎の分岐先アドレスを
示す図である。
FIG. 4 is a diagram showing a branch destination address for each address of a branch destination memory;

【図5】図1の装置の動作を説明するために命令の進行
を示す例である。
FIG. 5 is an example showing the progress of an instruction to explain the operation of the device of FIG. 1;

【図6】2つの異なる暴走の例を示すためのアドレス空
間図である。
FIG. 6 is an address space diagram for showing two different runaway examples.

【主要部分の符号の説明】[Description of Signs of Main Parts]

11 CPU 11a プログラムカウンタ 12 アドレスバス 13 RAM 14 ROM 15 分岐先メモリ 16 暴走監視回路 17 データバス 20 分岐先レジスタ 21 アドレスインクリメンタ 22 分岐検知回路 23 分岐先アドレス比較回路 Reference Signs List 11 CPU 11a Program counter 12 Address bus 13 RAM 14 ROM 15 Branch destination memory 16 Runaway monitor circuit 17 Data bus 20 Branch destination register 21 Address incrementer 22 Branch detection circuit 23 Branch destination address comparison circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも1つの分岐命令を含む複数の
命令からなるプログラムが記憶されたプログラムメモリ
の記憶位置をプログラムカウンタの出力値によってアド
レス指定し、その指定された前記プログラムメモリの記
憶位置に記憶されたプログラムの命令を読み出して実行
するコンピュータシステムのプログラム暴走監視装置で
あって、 前記プログラムの分岐命令によって分岐した直後に実行
すべき命令が記憶されたプログラムメモリの記憶位置を
示す分岐先アドレスを記憶した分岐先記憶手段と、 前記プログラムカウンタの出力値が不連続に変化したこ
とを検知して分岐検知信号を発生する分岐検知手段と、 前記分岐検知信号に応答して前記プログラムカウンタの
出力値によって指定されるアドレスと前記分岐先記憶手
段に記憶された分岐先アドレスとを比較してその比較結
果が不一致であるならば暴走検出信号を発生する比較手
段と、を備えたことを特徴とするプログラム暴走監視装
置。
An address of a storage location of a program memory in which a program including a plurality of instructions including at least one branch instruction is stored is designated by an output value of a program counter, and stored at the designated storage location of the program memory. A program runaway monitoring device for a computer system that reads and executes an instruction of a program that has been executed, wherein a branch destination address indicating a storage location of a program memory in which an instruction to be executed is stored immediately after branching by a branch instruction of the program. Stored branch destination storage means; branch detection means for detecting that the output value of the program counter has changed discontinuously to generate a branch detection signal; output value of the program counter in response to the branch detection signal Stored in the branch destination storage means and the address specified by A program runaway comparing device for comparing the program with a branch destination address and generating a runaway detection signal if the comparison result indicates a mismatch.
【請求項2】 前記分岐検知手段は、前記プログラムカ
ウンタの初期値からクロックパルスに同期してアップ計
数してその計数値を出力するアドレスインクリメンタ
と、前記プログラムカウンタの出力値と前記アドレスイ
ンクリメンタの計数値とが不一致のとき分岐検知信号を
発生する分岐検知回路とを有することを特徴とする請求
項1記載のプログラム暴走監視装置。
2. An address incrementer for counting up from an initial value of the program counter in synchronization with a clock pulse and outputting the count value, and an output value of the program counter and an address incrementer. 2. The program runaway monitoring device according to claim 1, further comprising: a branch detection circuit for generating a branch detection signal when the count value does not match.
【請求項3】 前記分岐先記憶手段には前記プログラム
メモリと同一のアドレス群が割り当てられており、前記
プログラムメモリにおいて分岐命令が記憶された記憶位
置のアドレスまでのアドレス順の各アドレスに対応する
前記分岐先記憶手段の各記憶位置にはその分岐命令の分
岐先アドレスが各々記憶されていることを特徴とする請
求項1記載のプログラム暴走監視装置。
3. The same address group as that of the program memory is allocated to the branch destination storage means, and the branch destination storage means corresponds to each address in the order of addresses up to the address of the storage position where the branch instruction is stored in the program memory. 2. The program runaway monitoring device according to claim 1, wherein a branch destination address of the branch instruction is stored in each storage location of the branch destination storage means.
JP8217359A 1996-08-19 1996-08-19 Program hang-up monitor device for computer system Pending JPH1063541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8217359A JPH1063541A (en) 1996-08-19 1996-08-19 Program hang-up monitor device for computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8217359A JPH1063541A (en) 1996-08-19 1996-08-19 Program hang-up monitor device for computer system

Publications (1)

Publication Number Publication Date
JPH1063541A true JPH1063541A (en) 1998-03-06

Family

ID=16702946

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8217359A Pending JPH1063541A (en) 1996-08-19 1996-08-19 Program hang-up monitor device for computer system

Country Status (1)

Country Link
JP (1) JPH1063541A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10240088B4 (en) * 2002-08-30 2007-11-29 Infineon Technologies Ag Data processing device
US7634640B2 (en) 2002-08-30 2009-12-15 Infineon Technologies Ag Data processing apparatus having program counter sensor
US7664939B2 (en) 2006-04-28 2010-02-16 Hitachi, Ltd. Method and apparatus for detecting false operation of computer
JP2011154459A (en) * 2010-01-26 2011-08-11 Renesas Electronics Corp Program abnormal operation detection device for computer system
JP2013140431A (en) * 2011-12-28 2013-07-18 Aisin Aw Co Ltd Vehicle-use control device and method
JP2014174758A (en) * 2013-03-08 2014-09-22 Denso Corp Processor
JP2018514306A (en) * 2015-04-28 2018-06-07 青▲島▼海▲尓▼洗衣机有限公司 Failure detection and processing method of washing machine

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10240088B4 (en) * 2002-08-30 2007-11-29 Infineon Technologies Ag Data processing device
US7634640B2 (en) 2002-08-30 2009-12-15 Infineon Technologies Ag Data processing apparatus having program counter sensor
US7664939B2 (en) 2006-04-28 2010-02-16 Hitachi, Ltd. Method and apparatus for detecting false operation of computer
JP2011154459A (en) * 2010-01-26 2011-08-11 Renesas Electronics Corp Program abnormal operation detection device for computer system
JP2013140431A (en) * 2011-12-28 2013-07-18 Aisin Aw Co Ltd Vehicle-use control device and method
US9080661B2 (en) 2011-12-28 2015-07-14 Aisin Aw Co., Ltd. Vehicle control device and method
JP2014174758A (en) * 2013-03-08 2014-09-22 Denso Corp Processor
JP2018514306A (en) * 2015-04-28 2018-06-07 青▲島▼海▲尓▼洗衣机有限公司 Failure detection and processing method of washing machine

Similar Documents

Publication Publication Date Title
US20090217090A1 (en) Method, operating system and computing hardware for running a computer program
US6212134B1 (en) Watch dog timer system
KR100894251B1 (en) Memory module system with multiple SPD ROM and boothing method of the memory module system
KR860003552A (en) Micro programmable system
JPH1063541A (en) Program hang-up monitor device for computer system
JP2508305B2 (en) Initial value determination device
JP2988518B2 (en) Multiprocessor control method
JPS62175834A (en) Detecting circuit for runaway of central processing unit
JPH0512013A (en) Data processor
JPS629442A (en) Error detecting circuit
JPH0764822A (en) Microcomputer
JPH0962534A (en) Self-diagnostic method for electronic computer
JPS6118045A (en) Detecting system of program runaway
CN116069442A (en) Information processing device, vehicle, and information processing method
JP2000020498A (en) Microcomputer and its restoring method
JPS63155330A (en) Microprogram controller
JPH0612292A (en) Microcomputer
JPS59191662A (en) Detecting system for program runaway
JPH11110207A (en) Information processor
JPH08235026A (en) Cpu operation abnormality detection system
JPH11272490A (en) Dlagnostic control system
JPS61213938A (en) Generation system for address coincidence signal
JPH11306047A (en) Runaway detecting device
JPH04318628A (en) Central processing unit
JPS62166449A (en) History storage device for logical unit