JPH0816434A - Runaway detection device - Google Patents

Runaway detection device

Info

Publication number
JPH0816434A
JPH0816434A JP6147907A JP14790794A JPH0816434A JP H0816434 A JPH0816434 A JP H0816434A JP 6147907 A JP6147907 A JP 6147907A JP 14790794 A JP14790794 A JP 14790794A JP H0816434 A JPH0816434 A JP H0816434A
Authority
JP
Japan
Prior art keywords
address
cpu
data
runaway
accessed
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
JP6147907A
Other languages
Japanese (ja)
Inventor
Yoshinori Doi
良規 土居
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Design Corp
Mitsubishi Electric Corp
Mitsubishi Electric Semiconductor Systems Corp
Original Assignee
Renesas Design Corp
Mitsubishi Electric Corp
Mitsubishi Electric Semiconductor Systems Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Design Corp, Mitsubishi Electric Corp, Mitsubishi Electric Semiconductor Systems Corp filed Critical Renesas Design Corp
Priority to JP6147907A priority Critical patent/JPH0816434A/en
Publication of JPH0816434A publication Critical patent/JPH0816434A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Abstract

PURPOSE:To optionally set runaway state detection timing and prevent the load on a CPU from being increased by judging the match of an expected value of data outputted when a storage part is accessed and data outputted onto a data bus. CONSTITUTION:A program for initialization is stored in a memory 2, when a CPU 1 starts executing the program, an address to be noticed for runaway detection of the CPU 1 is stored in an address register 5 and the expected value expected to be outputted to a data signal line 10 when the address stored in the address register 5 is accessed is stored in the data register 6. Then a comparator 3 compares the address stored in the address register 5 with the address outputted onto the address signal line 9 and a comparator 4 compares the data read out of the memory to a data signal line 10 with the expected value stored in the data register 6, and a runaway processing part 8 performs runaway processing when the output of its output terminal is at H level.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、シングルチップマイ
クロコンピュータのCPUの暴走を検出する暴走検出回
路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a runaway detection circuit for detecting runaway of a CPU of a single chip microcomputer.

【0002】[0002]

【従来の技術】従来のマイクロコンピュータでは時とし
て種々の要因によりCPUが誤動作を行いプログラムに
従った動作を実行しない状態、いわゆる暴走状態に陥る
場合が生じる。図13は、従来の暴走検出回路の構成を
示すブロック図である。図において201はカウンタ、
202は暴走処理回路、203はクロック信号が入力さ
れるクロック入力信号線、204は図示していないCP
Uからリセット信号が送られてくるリセット信号入力
線、205はカウンタ201から暴走処理回路202へ
オーバーフロー信号が出力されるオーバーフロー信号出
力線である。
2. Description of the Related Art In a conventional microcomputer, sometimes a CPU malfunctions due to various factors and falls into a so-called runaway state in which the operation according to a program is not executed. FIG. 13 is a block diagram showing the configuration of a conventional runaway detection circuit. In the figure, 201 is a counter,
202 is a runaway processing circuit, 203 is a clock input signal line to which a clock signal is input, and 204 is a CP not shown.
A reset signal input line from which a reset signal is sent from U, and 205 is an overflow signal output line from which an overflow signal is output from the counter 201 to the runaway processing circuit 202.

【0003】次に動作について説明する。この暴走検出
回路では、カウンタ201がクロック入力信号線203
により送られてくるクロック信号を計数し、CPUが正
常動作を行っているときにはカウンタ201はリセット
信号入力線204を介してCPUから送られてくるリセ
ット信号によりオーバーフローする前にリセットされ、
カウンタ201はこれにより再度最初からクロック信号
の計数を行う。すなわち、CPUが正常動作を行ってい
る限りカウンタ201はオーバーフローすることはな
い。
Next, the operation will be described. In this runaway detection circuit, the counter 201 uses the clock input signal line 203
When the CPU is operating normally, the counter 201 is reset by the reset signal sent from the CPU via the reset signal input line 204 before it overflows.
Accordingly, the counter 201 counts the clock signal again from the beginning. That is, the counter 201 does not overflow as long as the CPU is operating normally.

【0004】一方、CPUが暴走状態に陥ると送られて
くるリセット信号の周期が長くなったり、リセット信号
が送られてこなくなりカウンタ201はオーバーフロー
し、オーバーフロー信号が暴走処理回路202に入力さ
れ、これにより暴走処理回路202はCPUリセット信
号あるいは割込み信号の生成などを行うことになる。
On the other hand, when the CPU falls into a runaway state, the cycle of the reset signal sent becomes long, or the reset signal is not sent, the counter 201 overflows, and the overflow signal is input to the runaway processing circuit 202. This causes the runaway processing circuit 202 to generate a CPU reset signal or an interrupt signal.

【0005】[0005]

【発明が解決しようとする課題】従来の暴走検出回路は
以上のように構成されているので、CPUの暴走により
カウンタ201をリセットするリセット信号の周期がC
PUの正常動作による周期より短い周期になるなどした
場合には、カウンタ201はCPUの正常動作時と同様
にオーバーフローする以前にリセットされてしまう結
果、CPUの暴走状態を検出できない問題点があった。
Since the conventional runaway detection circuit is configured as described above, the cycle of the reset signal for resetting the counter 201 by the runaway of the CPU is C
When the cycle becomes shorter than the normal operation cycle of the PU, the counter 201 is reset before overflow as in the normal operation of the CPU. As a result, the runaway state of the CPU cannot be detected. .

【0006】また、CPUの暴走状態によりカウンタ2
01をリセットするリセット信号の周期が長くなったと
きには、最悪の場合、カウンタ201のリセットされた
ときの内部状態値からオーバーフローするまでの間は暴
走状態が続いてしまう問題点があった。
Further, the counter 2 can be operated depending on the runaway state of the CPU.
When the cycle of the reset signal for resetting 01 is long, in the worst case, there is a problem that the runaway state continues until the internal state value when the counter 201 is reset until it overflows.

【0007】カウンタ201がリセットされたときの内
部状態値からオーバーフローするまでの間の周期を短く
すると、CPUの正常動作に伴って生成されるカウンタ
をリセットするリセット信号の繰り返し周期を短くしな
ければならず、本来のプログラム中に前記リセット信号
を出力するためのクリア命令を多数挿入することにな
り、CPUの負担が増加する問題点があった。
If the cycle from the internal state value when the counter 201 is reset to the overflow is shortened, the repetition cycle of the reset signal for resetting the counter generated in accordance with the normal operation of the CPU must be shortened. However, a large number of clear instructions for outputting the reset signal are inserted in the original program, which causes a problem of increasing the load on the CPU.

【0008】請求項1の発明は上記のような問題点を解
消するためになされたもので、暴走状態を検出するタイ
ミングを任意に設定できると共に、CPUの負担の増加
を招来しない暴走検出回路を得ることを目的とする。
The first aspect of the present invention has been made to solve the above problems, and provides a runaway detecting circuit which can set the timing for detecting the runaway state arbitrarily and does not increase the load on the CPU. The purpose is to get.

【0009】請求項2の発明は、暴走状態を検出するタ
イミングを任意に設定できると共に、CPUに負担をか
けることなく暴走状態を検出する際の応答性を向上さ
せ、暴走状態の検出の際の信頼性を向上させた暴走検出
回路を得ることを目的とする。
According to the second aspect of the present invention, the timing for detecting the runaway state can be arbitrarily set, the responsiveness in detecting the runaway state can be improved without imposing a load on the CPU, and the runaway state can be detected. The purpose is to obtain a runaway detection circuit with improved reliability.

【0010】請求項3の発明は、暴走状態を検出するタ
イミングを任意に設定できると共に、CPUに負担をか
けることなく暴走状態の検出の際の応答性および暴走状
態の検出精度の向上を可能にする暴走検出回路を得るこ
とを目的とする。
According to the third aspect of the present invention, the timing for detecting the runaway state can be arbitrarily set, and the response at the time of detecting the runaway state and the accuracy of detecting the runaway state can be improved without imposing a burden on the CPU. The purpose is to obtain a runaway detection circuit that operates.

【0011】請求項4の発明は、CPUに負担をかける
ことなく暴走状態の検出の際の応答性および暴走状態の
検出精度の向上を可能にする暴走検出回路を得ることを
目的とする。
It is an object of the present invention to provide a runaway detection circuit capable of improving the responsiveness at the time of detecting the runaway state and the accuracy of detecting the runaway state without imposing a burden on the CPU.

【0012】請求項5の発明は、CPUに負担をかける
ことなく暴走状態を検出するタイミングを設定する際の
設定精度を向上させた暴走検出回路を得ることを目的と
する。
It is an object of the present invention to provide a runaway detection circuit with improved setting accuracy when setting the timing for detecting a runaway state without imposing a burden on the CPU.

【0013】請求項6の発明は、CPUに負担をかける
ことなく暴走状態の検出の際のタイミングをある幅を有
して設定できる暴走検出回路を得ることを目的とする。
It is an object of the present invention to provide a runaway detection circuit capable of setting a timing for detecting a runaway state with a certain width without imposing a burden on the CPU.

【0014】[0014]

【課題を解決するための手段】請求項1の発明に係る暴
走検出回路は、CPUによりアクセスされる記憶部の任
意のアドレスおよびそのアドレスがアクセスされたとき
のデータバス上に出力されるデータに対する期待値を設
定する設定手段と、前記CPUが前記アドレスをアクセ
スしたときの前記データバス上に出力されるデータと前
記設定手段により設定された期待値との一致を判断する
ことで前記CPUの暴走状態を判定する暴走判定回路と
を備えたものである。
According to another aspect of the present invention, there is provided a runaway detection circuit for an arbitrary address of a storage unit accessed by a CPU and data output on a data bus when the address is accessed. The setting means for setting the expected value and the runaway of the CPU by judging the match between the data output on the data bus when the CPU accesses the address and the expected value set by the setting means And a runaway determination circuit for determining the state.

【0015】請求項2の発明に係る暴走検出回路は、C
PUによりアクセスされる記憶部の任意の複数のアドレ
スおよび前記複数の夫々のアドレスがアクセスされたと
きにデータバス上に夫々出力されるデータに対する期待
値を設定する設定手段を備えたものである。
The runaway detection circuit according to the invention of claim 2 is C
It is provided with an arbitrary plurality of addresses of the storage unit accessed by the PU and a setting means for setting an expected value for the data output on the data bus when the respective addresses are accessed.

【0016】請求項3の発明に係る暴走検出回路は、C
PUによりアクセスされる記憶部の任意の複数のアドレ
スを設定するアドレス設定手段と、該アドレス設定手段
により設定されたアドレスに対するアクセスが所定の順
で実行されているか否かを判断することで前記CPUの
暴走状態を判定する順序判定回路とを備えたものであ
る。
The runaway detection circuit according to the invention of claim 3 is C
The address setting means for setting an arbitrary plurality of addresses in the storage unit accessed by the PU, and the CPU by judging whether or not the addresses set by the address setting means are accessed in a predetermined order. And an order determination circuit for determining the runaway state of.

【0017】請求項4の発明に係る暴走検出回路は、C
PUによりアクセスされる記憶部の命令コードを記憶し
た任意のアドレスを設定するアドレス設定手段と、該ア
ドレス設定手段により設定されたアドレスがアクセスさ
れたときの前記CPUが取り込むデータが命令コードで
あるか否かを判断することで前記CPUの暴走状態を判
定する命令コード判定回路とを備えたものである。
The runaway detection circuit according to the invention of claim 4 is C
Address setting means for setting an arbitrary address storing the instruction code of the storage unit accessed by the PU, and whether the data fetched by the CPU when the address set by the address setting means is the instruction code An instruction code judging circuit for judging the runaway state of the CPU by judging whether or not it is provided.

【0018】請求項5の発明に係る暴走検出回路は、C
PUによりアクセスされる記憶部の任意のアドレス範囲
を設定するアドレス範囲設定手段と、該アドレス範囲設
定手段により設定されたアドレス範囲がアクセスされた
ときのそのアドレス範囲に含まれる命令コードの次ぎの
データ値を設定するデータ値設定手段と、前記アドレス
範囲がアクセスされたときに取り込まれる命令コードの
次ぎのデータ値が前記データ値設定手段により設定され
たデータ値であるか否かを判断することで前記CPUの
暴走状態を判定するチェックデータ判定回路とを備えた
ものである。
The runaway detection circuit according to the invention of claim 5 is C
Address range setting means for setting an arbitrary address range of the storage unit accessed by the PU, and data next to the instruction code included in the address range set by the address range setting means when the address range is accessed By determining the data value setting means for setting a value and determining whether the data value next to the instruction code fetched when the address range is accessed is the data value set by the data value setting means. A check data determination circuit for determining the runaway state of the CPU is provided.

【0019】請求項6の発明に係る暴走検出回路は、C
PUによりアクセスされる記憶部の任意のアドレス範囲
を設定するアドレス範囲設定手段と、該アドレス範囲設
定手段により設定されたアドレス範囲がアクセスされた
ときのデータバス上に出力されるもしくは出力されるこ
とのない命令コードの範囲を設定する命令コード設定手
段と、前記アドレス範囲がアクセスされたときに前記C
PUに取り込まれる命令コードが前記命令コード設定手
段により設定された範囲の命令コードであるか否かを判
断することで前記CPUの暴走状態を判定する命令コー
ド範囲判定回路とを備えたものである。
The runaway detection circuit according to the invention of claim 6 is C
Address range setting means for setting an arbitrary address range of the storage unit accessed by the PU, and output or output on the data bus when the address range set by the address range setting means is accessed And an instruction code setting means for setting a range of instruction codes that does not exist, and C when the address range is accessed.
An instruction code range determination circuit for determining the runaway state of the CPU by determining whether the instruction code fetched by the PU is within the range set by the instruction code setting means. .

【0020】[0020]

【作用】請求項1の発明における暴走検出回路は、CP
Uが暴走するとデータバス上に出力されるデータが異常
となることから、CPUによりアクセスされる任意のア
ドレスおよびそのアドレスがアクセスされたときのデー
タバス上に出力されるデータに対する期待値をあらかじ
め設定し、前記CPUにより前記アドレスから読み出さ
れ前記データバス上に出力されるデータと前記設定した
期待値との一致を判定し、不一致のときにはCPUの暴
走状態と判定し、CPUのプログラムの実行動作を直接
監視することで、CPUの負担の増加を伴うことなく暴
走状態を検出するタイミングを任意に設定することを可
能にする。
According to the first aspect of the present invention, the runaway detection circuit has a CP
Since the data output on the data bus becomes abnormal if U runs out of control, the expected value for the arbitrary address accessed by the CPU and the data output on the data bus when that address is accessed is set in advance. Then, it is determined whether the data read from the address by the CPU and output on the data bus matches the set expected value. If they do not match, it is determined that the CPU is in a runaway state, and the CPU executes the program. It is possible to arbitrarily set the timing for detecting the runaway state without increasing the load on the CPU by directly monitoring.

【0021】請求項2の発明における暴走検出回路は、
複数のアドレスを設定し、その設定したアドレスがアク
セスされたときに読み出されるはずの期待値であるデー
タを複数備えておき、CPUのプログラムの実行動作を
直接監視することで前記設定した夫々のアドレスがアク
セスされたときに実際に読み出されるデータと前記期待
値との一致を判定し、不一致のときにはCPUの暴走状
態と判定することで暴走状態を検出するタイミングを任
意に設定可能にすると共に、CPUに負担をかけること
なく暴走状態を検出する際の応答性を向上させ、暴走状
態の検出の際の信頼性の向上を実現する。
The runaway detection circuit according to the invention of claim 2 is
By setting a plurality of addresses, providing a plurality of data that are expected values that should be read when the set addresses are accessed, and directly monitoring the execution operation of the program of the CPU, each of the set addresses is set. When data is accessed, it is determined whether the data actually read and the expected value match, and if they do not match, it is possible to set the timing for detecting the runaway state by determining the runaway state of the CPU, and The responsiveness when detecting a runaway state is improved without imposing a burden on the robot, and the reliability is improved when a runaway state is detected.

【0022】請求項3の発明における暴走検出回路は、
アクセスされる任意の複数のアドレスをあらかじめ設定
しておき、その設定されたアドレスに対するアクセスが
所定の順で実行されているか否かをCPUの動作を直接
監視することで判断し、暴走状態を検出するタイミング
を任意に設定可能にすると共に、CPUに負担をかける
ことなく暴走状態の検出の際の応答性および暴走状態の
検出精度の向上を可能にする。
The runaway detection circuit according to the invention of claim 3 is
A plurality of arbitrary addresses to be accessed are set in advance, and it is judged whether the access to the set addresses is executed in a predetermined order by directly monitoring the operation of the CPU, and the runaway state is detected. It is possible to arbitrarily set the timing to perform, and it is possible to improve the responsiveness when detecting the runaway state and the accuracy of detecting the runaway state without imposing a burden on the CPU.

【0023】請求項4の発明における暴走検出回路は、
命令コードを記憶した任意のアドレスをあらかじめ設定
し、設定された前記アドレスがアクセスされたときのC
PUが取り込むデータが命令コードであるか否かをCP
Uの動作を直接監視することで判断し、CPUに負担を
かけることなく暴走状態の検出の際の応答性および暴走
状態の検出精度の向上を可能にする。
The runaway detection circuit in the invention of claim 4 is
An arbitrary address storing the instruction code is set in advance, and C when the set address is accessed
CP whether the data taken in by the PU is an instruction code
It is possible to improve the responsiveness at the time of detecting a runaway state and the accuracy of detecting the runaway state without imposing a burden on the CPU by making a judgment by directly monitoring the operation of U.

【0024】請求項5の発明における暴走検出回路は、
アクセスされる任意のアドレス範囲と、そのアドレス範
囲がアクセスされたときのそのアドレス範囲に含まれる
命令コードの次ぎのデータ値とを設定し、前記アドレス
範囲が実際にアクセスされたときに取り込まれる命令コ
ードの次ぎのデータ値が前記設定されたデータ値である
か否かをCPUの動作を直接監視することで判断し、暴
走状態を判定し、暴走状態を検出するタイミングを設定
する際の設定精度の向上をCPUに負担をかけることな
く実現する。
The runaway detecting circuit in the invention of claim 5 is
An instruction that sets an arbitrary address range to be accessed and a data value next to an instruction code included in the address range when the address range is accessed, and is fetched when the address range is actually accessed Setting accuracy when determining whether the data value next to the code is the set data value by directly monitoring the CPU operation, determining the runaway state, and setting the timing for detecting the runaway state Is achieved without imposing a burden on the CPU.

【0025】請求項6の発明における暴走検出回路は、
アクセスされる任意のアドレス範囲と、設定した前記ア
ドレス範囲がアクセスされたときのデータバス上に出力
されるもしくは出力されることのない命令コードの範囲
とをあらかじめ設定し、前記アドレス範囲がアクセスさ
れたときにCPUに取り込まれる命令コードが前記設定
した範囲の命令コードであるか否かを前記CPUの動作
を直接監視して判断し、前記CPUに取り込まれる命令
コードが前記設定した範囲の命令コードでないとき、も
しくは命令コードであるときにはCPUの暴走と判定す
ることで、暴走状態の検出のタイミングをCPUに負担
をかけることなくある幅の中で設定することを可能にす
る。
The runaway detection circuit in the invention of claim 6 is
An arbitrary address range to be accessed and a range of instruction codes output or not output on the data bus when the set address range is accessed are set in advance, and the address range is accessed. If the instruction code taken into the CPU is within the set range, it is determined by directly monitoring the operation of the CPU, and the instruction code taken into the CPU is within the set range. If it is not, or if it is an instruction code, it is possible to set the timing for detecting the runaway state within a certain width without imposing a burden on the CPU by determining that the CPU is running out of control.

【0026】[0026]

【実施例】【Example】

実施例1.以下、請求項1の発明の一実施例を図につい
て説明する。図1は本実施例の暴走検出回路の構成を示
すブロック図である。図において1はCPU(設定手
段)、2はメモリ、3はアドレス信号線9に出力される
16ビットのアドレスデータとアドレスレジスタ5(設
定手段)に格納されたアドレスデータとを比較する比較
器(暴走判定回路)であり、16ビットのアドレスデー
タとアドレスレジスタ5に格納されたアドレスデータと
の比較結果が一致を示すときには比較結果出力端子Yの
出力は‘H’レベルとなる。4は前記アドレスレジスタ
5に格納されたアドレスがアクセスされたとき、データ
信号線10に出力される8ビットのデータとデータレジ
スタ6(設定手段)に格納された期待値であるデータと
を比較する比較器(暴走判定回路)であり、データ信号
線10に出力された8ビットのデータとデータレジスタ
6に格納されたデータとの比較結果が一致を示すときに
比較結果出力端子YBの出力は‘L’レベルとなる。7
は比較器3から出力される比較結果と比較器4から出力
される比較結果との論理積演算を行う2入力AND回路
(暴走判定回路)、8は2入力AND回路7の出力が
‘H’レベルになることで暴走処理を行う暴走処理部で
ある。11はアドレスレジスタ5に対しアドレスを、デ
ータレジスタ6に対しデータを書き込むためのレジスタ
制御信号が出力されるレジスタ制御信号線である。
Example 1. An embodiment of the invention of claim 1 will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. In the figure, 1 is a CPU (setting means), 2 is a memory, and 3 is a comparator which compares the 16-bit address data output to the address signal line 9 with the address data stored in the address register 5 (setting means) ( When the comparison result of the 16-bit address data and the address data stored in the address register 5 indicates a match, the output of the comparison result output terminal Y becomes the “H” level. Reference numeral 4 compares the 8-bit data output to the data signal line 10 with the expected value data stored in the data register 6 (setting means) when the address stored in the address register 5 is accessed. It is a comparator (runaway judgment circuit), and when the comparison result of the 8-bit data output to the data signal line 10 and the data stored in the data register 6 indicates a match, the output of the comparison result output terminal YB is' It becomes L'level. 7
Is a 2-input AND circuit (runaway determination circuit) that performs a logical product operation of the comparison result output from the comparator 3 and the comparison result output from the comparator 4, and 8 is the output of the 2-input AND circuit 7 being “H”. It is a runaway processing unit that performs runaway processing when it reaches a level. Reference numeral 11 is a register control signal line for outputting a register control signal for writing an address to the address register 5 and writing data to the data register 6.

【0027】図2は、比較器4の構成を示す論理回路図
であり、101a,101b,101c,101d,1
01e,101f,101gはデータ信号線10に出力
されたデータの各ビットとデータレジスタ6に格納され
たデータの各ビット毎の一致を検出するexOR回路、
102は前記各exOR回路の出力の論理和演算を行い
その演算結果を出力するOR回路である。
FIG. 2 is a logic circuit diagram showing the configuration of the comparator 4, 101a, 101b, 101c, 101d, 1
Reference numerals 01e, 101f, and 101g denote exOR circuits that detect a match between each bit of the data output to the data signal line 10 and each bit of the data stored in the data register 6,
Reference numeral 102 is an OR circuit that performs a logical sum operation on the outputs of the exOR circuits and outputs the operation result.

【0028】図3は、比較器3の構成を示すブロック図
であり、アドレス信号線9に出力される下位8ビットの
アドレスデータとアドレスレジスタ5に格納された下位
8ビットのアドレスデータとを比較する比較器3aと、
アドレス信号線9に出力される上位8ビットのアドレス
データとアドレスレジスタ5に格納された上位8ビット
のアドレスデータとを比較する比較器3bと、比較器3
aと比較器3bの比較結果出力端子YBから出力される
信号の論理和演算結果を反転して出力するNOR回路1
03から構成されている。比較器3aと比較器3bの構
成は、図2に示す比較器4と同様である。
FIG. 3 is a block diagram showing the configuration of the comparator 3, which compares the lower 8-bit address data output to the address signal line 9 with the lower 8-bit address data stored in the address register 5. A comparator 3a for
Comparator 3b for comparing the upper 8-bit address data output to address signal line 9 with the upper 8-bit address data stored in address register 5, and comparator 3
NOR circuit 1 which inverts and outputs the logical sum operation result of the signal output from the comparison result output terminal YB of a and the comparator 3b
It is composed of 03. The configurations of the comparators 3a and 3b are similar to those of the comparator 4 shown in FIG.

【0029】図4は、データレジスタ6の構成を示す論
理回路図であり、8ビットデータの各ビットをラッチす
るDフリップフロップ104a,104b,104c,
104d,104e,104f,104g,104hか
ら構成されている。107は8ビットデータの各ビット
をラッチするためのクロック信号が出力されるクロック
信号線である。
FIG. 4 is a logic circuit diagram showing the structure of the data register 6, which is a D flip-flop 104a, 104b, 104c, which latches each bit of 8-bit data.
It is composed of 104d, 104e, 104f, 104g and 104h. Reference numeral 107 denotes a clock signal line for outputting a clock signal for latching each bit of 8-bit data.

【0030】次に動作について説明する。メモリ2には
CPU1が実行するプログラムが格納されている。この
プログラムはユーザにより作成された種々のプログラム
であるが、CPU1の暴走状態を検出するためのCPU
1の正常動作によりアクセスされるアドレスおよびその
アドレスがアクセスされたときに読み出されるデータに
対する期待値をプログラム実行の初期の段階で夫々アド
レスレジスタ5とデータレジスタ6に転送し格納する初
期設定用プログラムがプログラムの先頭部分に挿入され
ている。従って、CPUがプログラムの実行を開始する
と、最初アドレスレジスタ5にはCPU1の暴走検出の
ために着目すべきアドレスが格納され、またデータレジ
スタ6にはアドレスレジスタ5に格納されたアドレスが
アクセスされたときにデータ信号線10に出力されるこ
とが期待される期待値が格納される。
Next, the operation will be described. A program executed by the CPU 1 is stored in the memory 2. Although this program is various programs created by the user, it is a CPU for detecting the runaway state of the CPU 1.
An initial setting program for transferring and storing the address accessed by the normal operation of No. 1 and the expected value for the data read when the address is accessed to the address register 5 and the data register 6 at the initial stage of program execution, respectively. It is inserted at the beginning of the program. Therefore, when the CPU starts executing the program, first the address register 5 stores the address to be noticed for the runaway detection of the CPU 1, and the data register 6 accesses the address stored in the address register 5. An expected value that is expected to be output to the data signal line 10 at times is stored.

【0031】この結果、CPU1によるプログラムの実
行動作が開始されると比較器3はアドレスレジスタ5に
格納されたアドレスとアドレス信号線9上に出力された
アドレスの比較を行い、一致しない状態では‘L’レベ
ル、一致すると‘H’レベルの信号を比較結果出力端子
Yから2入力AND回路7の一方の入力端子に出力す
る。またこのとき比較器4はデータ信号線10に出力さ
れるメモリから読み出され、あるいはメモリに書き込ま
れるデータとデータレジスタ6に格納されている期待値
であるデータとの比較を行い、一致しない状態では
‘H’レベル、一致すると‘L’レベルの信号を比較結
果出力端子YBから2入力AND回路7の他方の入力端
子に出力する。
As a result, when the execution operation of the program by the CPU 1 is started, the comparator 3 compares the address stored in the address register 5 with the address output on the address signal line 9, and when they do not match, When it matches, it outputs a signal of L level, or H level from the comparison result output terminal Y to one input terminal of the 2-input AND circuit 7. Further, at this time, the comparator 4 compares the data read from the memory output to the data signal line 10 or written in the memory with the expected value data stored in the data register 6 to determine that they do not match. Then, the signal of the “H” level and the signal of the “L” level when they match are output from the comparison result output terminal YB to the other input terminal of the 2-input AND circuit 7.

【0032】従って、CPU1が暴走しアドレスレジス
タが示すアドレスから本来の読み出されるはずのデータ
がデータ信号線10へ読み出されなかったり、あるいは
アドレスレジスタ6が示すアドレスへ書き込むべきデー
タがデータ信号線10へ出力されないような状態になる
と、比較器4の比較結果出力端子Yの出力は‘H’レベ
ルとなり、2入力AND回路7の出力も‘H’レベルと
なり、暴走処理部8は暴走処理を行う。
Therefore, the CPU 1 is out of control and the data originally intended to be read from the address indicated by the address register is not read to the data signal line 10, or the data to be written at the address indicated by the address register 6 is the data signal line 10. When the output is not output to the output terminal, the output of the comparison result output terminal Y of the comparator 4 becomes'H 'level, the output of the 2-input AND circuit 7 also becomes'H' level, and the runaway processing unit 8 performs runaway processing. .

【0033】このように、本実施例の暴走検出回路はC
PU1の動作によりアドレス信号線9に出力されるアド
レスとデータ信号線10に出力されるデータとを、アド
レスレジスタ5に格納されたアドレスデータとデータレ
ジスタ6に格納された期待値を基に直接監視しCPUの
暴走状態を検出することになるので、暴走を検出するタ
イミングを任意に設定することが可能であり、従来のよ
うにタイマを用いる場合に比べて本来のプログラム中に
タイマのクリア命令などを配置する必要がなくなり、C
PUの負担の増加を伴うことがなく、CPUは本来のプ
ログラム実行動作を効率よく行うことが可能となる。
As described above, the runaway detection circuit of this embodiment has C
The address output to the address signal line 9 and the data output to the data signal line 10 by the operation of the PU 1 are directly monitored based on the address data stored in the address register 5 and the expected value stored in the data register 6. However, since the runaway state of the CPU is detected, it is possible to arbitrarily set the timing for detecting the runaway. Compared to the case where a timer is used as in the past, a clear instruction of the timer in the original program etc. It is no longer necessary to place
The CPU can efficiently perform the original program execution operation without increasing the load on the PU.

【0034】実施例2.以下、請求項2の発明の一実施
例を図について説明する。図5は、本実施例の暴走検出
回路の構成を示すブロック図である。図5において図1
と同一または相当の部分については同一の符号を付し説
明を省略する。
Embodiment 2 FIG. An embodiment of the invention of claim 2 will be described below with reference to the drawings. FIG. 5 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. In FIG.
The same or corresponding parts are designated by the same reference numerals and the description thereof will be omitted.

【0035】前記実施例1の暴走検出回路は1つのアド
レスがアクセスされたときにデータ信号線10上に実際
出力されるデータと本来出力されなければならないデー
タ、いわゆる期待値との一致あるいは不一致を検出する
ことでCPUの暴走状態を判定するものであったのに対
し、本実施例の暴走検出回路では複数のアドレスのアク
セスに対し前記実施例1において説明した手段と同様な
手段により夫々信号線10上に実際出力されるデータと
本来出力されなければならないデータ、いわゆる期待値
との一致あるいは不一致を検出することでCPUの暴走
状態を判定する。
In the runaway detection circuit of the first embodiment, when one address is accessed, the data actually output on the data signal line 10 and the data that should be originally output, that is, the so-called expected value, are matched or mismatched. While the runaway state of the CPU is determined by the detection, the runaway detection circuit of this embodiment uses the same means as the means described in the first embodiment to access a plurality of addresses, respectively. The runaway state of the CPU is determined by detecting a match or a mismatch between the data that is actually output on 10 and the data that should be output, that is, an expected value.

【0036】図5において比較器(3−1)は図1にお
ける比較器3に対応し、また比較器(4−1)は比較器
4に対応している。また、アドレスレジスタ(5−1)
は図1におけるアドレスレジスタ5に、さらにデータレ
ジスタ(6−1)はデータレジスタ6に対応している。
またAND回路(7−1)は図1に示すAND回路7に
対応している。比較器(3−1)と比較器(4−1)と
アドレスレジスタ(5−1)とデータレジスタ(6−
1)とAND回路(7−1)によりアドレスレジスタ
(5−1)に格納された第1のアドレスがアクセスされ
たときにデータ信号線10上に実際出力されるデータと
本来出力されなければならないデータレジスタ(6−
1)に格納されたデータ、いわゆる期待値との一致ある
いは不一致を検出することでCPUの暴走状態を判定す
る。
In FIG. 5, the comparator (3-1) corresponds to the comparator 3 in FIG. 1, and the comparator (4-1) corresponds to the comparator 4. Also, the address register (5-1)
Corresponds to the address register 5 in FIG. 1, and the data register (6-1) corresponds to the data register 6.
The AND circuit (7-1) corresponds to the AND circuit 7 shown in FIG. Comparator (3-1), comparator (4-1), address register (5-1) and data register (6-
1) and the AND circuit (7-1) must access the first address stored in the address register (5-1) and the data actually output on the data signal line 10 when the first address is accessed. Data register (6-
The runaway state of the CPU is determined by detecting whether or not the data stored in 1) matches the so-called expected value.

【0037】さらに、比較器(3−1)と比較器(4−
1)とアドレスレジスタ(5−1)とデータレジスタ
(6−1)とAND回路(7−1)とからなる回路構成
と同様に接続された比較器(3−2)と比較器(4−
2)とアドレスレジスタ(5−2)とデータレジスタ
(6−2)とAND回路(7−2)とにより、アドレス
レジスタ(5−2)に格納された第2のアドレスがアク
セスされたときにデータ信号線10上に実際出力される
データと本来出力されなければならないデータレジスタ
(6−2)に格納されたデータ、いわゆる期待値との一
致あるいは不一致を検出することでCPUの暴走状態を
判定する。
Further, the comparator (3-1) and the comparator (4-
1), the address register (5-1), the data register (6-1), and the AND circuit (7-1), which are connected in the same manner as the comparator (3-2) and the comparator (4-).
2), the address register (5-2), the data register (6-2) and the AND circuit (7-2) access the second address stored in the address register (5-2). The runaway state of the CPU is determined by detecting a match or a mismatch between the data actually output on the data signal line 10 and the data stored in the data register (6-2) that should be originally output, a so-called expected value. To do.

【0038】AND回路(7−1)の出力とAND回路
(7−2)の出力は、OR回路21を介して暴走処理部
8に入力され、アドレスレジスタ(5−1)に格納され
た第1のアドレスがアクセスされたときにデータ信号線
10上に実際出力されるデータと本来出力されなければ
ならないデータレジスタ(6−1)に格納された期待値
であるデータとの不一致、あるいはアドレスレジスタ
(5−2)に格納された第2のアドレスがアクセスされ
たときにデータ信号線10上に実際出力されるデータと
本来出力されなければならないデータレジスタ(6−
2)に格納された期待値であるデータとの不一致のいず
れかが検出されることで暴走処理が実行される。
The output of the AND circuit (7-1) and the output of the AND circuit (7-2) are input to the runaway processing unit 8 via the OR circuit 21 and stored in the address register (5-1). When the address 1 is accessed, the data actually output on the data signal line 10 does not match the expected value data stored in the data register (6-1) that should originally be output, or the address register When the second address stored in (5-2) is accessed, the data actually output on the data signal line 10 and the data register (6-
The runaway process is executed when any of the mismatches with the expected value data stored in 2) is detected.

【0039】従って本実施例では、本来のプログラム中
の複数のアドレスおよびそれらアドレスがアクセスされ
たときにデータ線10上に夫々出力される複数のデータ
対し暴走状態の監視が行われることになるので、CPU
に負担をかけることなく暴走状態を検出する際の応答
性、および暴走検出の際の信頼性を向上させることがで
きる。
Therefore, in this embodiment, a plurality of addresses in the original program and a plurality of data output on the data line 10 when these addresses are accessed are monitored for runaway states. , CPU
It is possible to improve the responsiveness when detecting a runaway state and the reliability when a runaway is detected without imposing a burden on the.

【0040】実施例3.以下、請求項3の発明の一実施
例を図について説明する。図6は、本実施例の暴走検出
回路の構成を示すブロック図である。図6において図1
と同一または相当の部分については同一の符号を付し説
明を省略するが、図6における比較(3−1),(3−
2),(3−3),(3−4)は、図1における比較器
3と同様な機能および構成を有している。またアドレス
レジスタ(5−1),(5−2),(5−3),(5−
4)も図1に示すアドレスレジスタ5と同様な機能およ
び構成を有している。31は比較器(3−1),(3−
2),(3−3),(3−4)と夫々対応するアドレス
レジスタ(5−1),(5−2),(5−3),(5−
4)に格納されたアドレスデータと、アドレス線9上に
出力されたアドレスデータとが比較器(3−1)→比較
器(3−2)→比較器(3−3)→比較器(3−4)の
順序で一致するか否かを判定する順序判定回路である。
32は比較器(3−1)の比較結果を示す信号が出力さ
れる比較結果出力信号線、33は比較器(3−2)の比
較結果を示す信号が出力される比較結果出力信号線、3
4は比較器(3−3)の比較結果を示す信号が出力され
る比較結果出力信号線、35は比較器(3−4)の比較
結果を示す信号が出力される比較結果出力信号線であ
る。
Example 3. An embodiment of the invention of claim 3 will be described below with reference to the drawings. FIG. 6 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. In FIG.
The same or corresponding parts as those in FIG.
2), (3-3) and (3-4) have the same function and configuration as the comparator 3 in FIG. Further, the address registers (5-1), (5-2), (5-3), (5-
4) also has the same function and configuration as the address register 5 shown in FIG. 31 is a comparator (3-1), (3-
2), (3-3) and (3-4) respectively corresponding address registers (5-1), (5-2), (5-3) and (5-
The address data stored in 4) and the address data output on the address line 9 are comparator (3-1) → comparator (3-2) → comparator (3-3) → comparator (3 -4) An order determination circuit for determining whether or not they match in the order.
32 is a comparison result output signal line from which a signal indicating the comparison result of the comparator (3-1) is output; 33 is a comparison result output signal line from which a signal indicating the comparison result of the comparator (3-2) is output; Three
Reference numeral 4 is a comparison result output signal line from which a signal indicating the comparison result of the comparator (3-3) is output, and 35 is a comparison result output signal line from which a signal indicating the comparison result of the comparator (3-4) is output. is there.

【0041】図7は、順序判定回路31の構成を示す論
理回路図であり、図6と同一の部分については同一の符
号を付し説明を省略する。図において31a,31b,
31c,31dはRSフリップフロップであり、RSフ
リップフロップ31aは比較器(3−1)から出力され
る一致比較結果を示す信号によりセットされ、またRS
フリップフロップ31dがセットされることでリセット
される。RSフリップフロップ31bは、RSフリップ
フロップ31aがセットされている状態で比較器(3−
2)から一致比較結果を示す信号が出力されたときにセ
ットされ、またRSフリップフロップ31aのリセット
によりセット状態が解除される。RSフリップフロップ
31cは、RSフリップフロップ31bがセットされて
いる状態で比較器(3−3)から一致比較結果を示す信
号が出力されたときにセットされ、またRSフリップフ
ロップ31aのリセットによりセット状態が解除され
る。RSフリップフロップ31dは、RSフリップフロ
ップ31cがセットされている状態で比較器(3−4)
から一致比較結果を示す信号が出力されたときにセット
され、またRSフリップフロップ31aがのリセットに
よりセット状態が解除される。
FIG. 7 is a logic circuit diagram showing the configuration of the order determination circuit 31, and the same parts as those in FIG. 6 are designated by the same reference numerals and the description thereof will be omitted. In the figure, 31a, 31b,
Reference numerals 31c and 31d are RS flip-flops, and the RS flip-flop 31a is set by a signal indicating the coincidence comparison result output from the comparator (3-1).
It is reset when the flip-flop 31d is set. The RS flip-flop 31b has a comparator (3-
It is set when the signal indicating the coincidence comparison result is output from 2), and the set state is released by resetting the RS flip-flop 31a. The RS flip-flop 31c is set when the RS flip-flop 31b is set and a signal indicating the coincidence comparison result is output from the comparator (3-3), and is set by resetting the RS flip-flop 31a. Is released. The RS flip-flop 31d has a comparator (3-4) in a state where the RS flip-flop 31c is set.
Is set when a signal indicating the coincidence comparison result is output from, and the set state is released by resetting the RS flip-flop 31a.

【0042】31e,31f,31g,31h,31
i,31jは2入力AND回路である。31kは2入力
AND回路31hと2入力AND回路31iと2入力A
ND回路31jの出力の論理和を演算して求める3入力
OR回路である。
31e, 31f, 31g, 31h, 31
i and 31j are 2-input AND circuits. 31k is a 2-input AND circuit 31h, a 2-input AND circuit 31i, and a 2-input A
It is a 3-input OR circuit that calculates and calculates the logical sum of the outputs of the ND circuit 31j.

【0043】なお、図6に示すCPU1とアドレスレジ
スタ(5−1),(5−2),(5−3),(5−4)
はアドレス設定手段に対応している。
The CPU 1 and the address registers (5-1), (5-2), (5-3), (5-4) shown in FIG.
Corresponds to the address setting means.

【0044】次に動作について図7に示す順序判定回路
31を中心に説明する。まず、CPU1が正常動作を行
っている場合について説明する。図7に示すRSフリッ
プフロップ31aはCPU1の初期設定動作あるいは電
源投入時において初期リセットされるものとする。ま
た、アドレスレジスタ(5−1),(5−2),(5−
3),(5−4)にはアクセスされる任意のアドレスデ
ータがCPU1の初期設定動作により格納される。本実
施例では、アドレスレジスタに格納されるアドレス値
は、「アドレスレジスタ(5−1)に格納されるアドレ
ス値」→「アドレスレジスタ(5−2)に格納されるア
ドレス値」→「アドレスレジスタ(5−3)に格納され
るアドレス値」→「アドレスレジスタ(5−4)に格納
されるアドレス値」の順で、アクセスされるタイミング
の早い番地から順に格納されてる。
Next, the operation will be described focusing on the order determination circuit 31 shown in FIG. First, a case where the CPU 1 is operating normally will be described. The RS flip-flop 31a shown in FIG. 7 is assumed to be initially reset when the CPU 1 is initialized or the power is turned on. Further, the address registers (5-1), (5-2), (5-
Arbitrary address data to be accessed is stored in 3) and (5-4) by the initial setting operation of the CPU 1. In the present embodiment, the address value stored in the address register is “address value stored in address register (5-1)” → “address value stored in address register (5-2)” → “address register The address values are stored in the order of "address value stored in (5-3)"->"address value stored in address register (5-4)" from the address with the earliest access timing.

【0045】CPU1が正常動作を行いプログラムを読
み取る動作を実行すると、比較器(3−1)→比較器
(3−2)→比較器(3−3)→比較器(3−4)の順
で一致比較結果を示す‘H’レベルの信号が順序判定回
路31に出力される。この結果、最初に比較器(3−
1)から出力される一致比較結果を示す信号によりRS
フリップフロップ31aはセットされ、2入力AND回
路31eのゲートが開く。この状態で今度は比較器(3
−2)から一致比較結果を示す信号が出力されるので、
この一致比較結果を示す信号によりRSフリップフロッ
プ31bがセットされる。このようにして順次RSフリ
ップフロップ31aからRSフリップフロップ31dま
で順にセットされて行く。RSフリップフロップ31d
がセットされQ出力が‘H’レベルになると、この
‘H’レベルの信号はRSフリップフロップ31aのリ
セット端子Rに供給されるから、RSフリップフロップ
31aはセット状態からリセット状態に戻る。そして、
次ぎの一致比較結果を示す信号が比較器(3−1)→比
較器(3−2)→比較器(3−3)→比較器(3−4)
の順で出力されるのを待つ。これら一連の過程でCPU
1が正常動作を行っており比較器(3−1)→比較器
(3−2)→比較器(3−3)→比較器(3−4)の順
で一致比較結果を示す信号が出力されている限り、2入
力AND回路31h,31i,31jの両入力端子が同
時に‘H’レベルになることはないので、3入力OR回
路31kからは‘H’レベルの暴走検出信号は出力され
ることはなく、暴走処理が行われることはない。
When the CPU 1 executes the normal operation and the operation of reading the program, the comparator (3-1) → comparator (3-2) → comparator (3-3) → comparator (3-4) in that order. An “H” level signal indicating the coincidence comparison result is output to the order determination circuit 31. As a result, the comparator (3-
The signal indicating the result of coincidence comparison output from 1)
The flip-flop 31a is set and the gate of the 2-input AND circuit 31e opens. In this state, the comparator (3
-2) outputs a signal indicating the match comparison result,
The RS flip-flop 31b is set by the signal indicating the result of the coincidence comparison. In this way, the RS flip-flops 31a to 31d are sequentially set. RS flip-flop 31d
Is set and the Q output goes to the “H” level, this “H” level signal is supplied to the reset terminal R of the RS flip-flop 31a, so that the RS flip-flop 31a returns from the set state to the reset state. And
The signal indicating the next coincidence comparison result is comparator (3-1) → comparator (3-2) → comparator (3-3) → comparator (3-4).
Wait for output in order. CPU in the process of these series
1 is operating normally, and a signal indicating the coincidence comparison result is output in the order of comparator (3-1) → comparator (3-2) → comparator (3-3) → comparator (3-4). As long as the two inputs AND circuits 31h, 31i, and 31j are not simultaneously set to the "H" level, the 3-input OR circuit 31k outputs the "H" level runaway detection signal. There is no such thing as a runaway process.

【0046】次にCPU1が暴走状態に陥った場合につ
いて説明する。CPU1が暴走するとCPU1のプログ
ラムの読取り動作などは混乱することになり、比較器
(3−1)→比較器(3−2)→比較器(3−3)→比
較器(3−4)の順で一致比較結果が順序判定回路31
に出力されなくなると考えられる。この場合、比較器
(3−1)以外の比較器から先に一致比較結果を示す信
号が順序判定回路31に出力されたり、順番に出力され
るはずの一致比較結果を示す信号のいずれかが抜けるこ
とになり、このような状態のときにはすべていずれかの
一致比較結果を示す信号が出力された時点で2入力AN
D回路31h,31i,31jのいずれかの両入力端子
が同時に‘H’レベルになる状態となり、3入力OR回
路31kからは‘H’レベルの暴走検出信号が出力さ
れ、暴走処理が行われる。
Next, a case where the CPU 1 falls into a runaway state will be described. If the CPU 1 runs out of control, the program reading operation of the CPU 1 will be confused, and the comparator (3-1) → comparator (3-2) → comparator (3-3) → comparator (3-4) The result of the coincidence comparison in order is the order determination circuit 31.
It is thought that it will not be output to. In this case, a comparator other than the comparator (3-1) outputs a signal indicating the coincidence comparison result first to the order determination circuit 31, or one of the signals indicating the coincidence comparison result that should be output in order. In such a state, the 2-input AN is output at the time when a signal indicating one of the coincidence comparison results is output.
Both of the input terminals of the D circuits 31h, 31i, and 31j are simultaneously set to the "H" level, and the "H" level runaway detection signal is output from the 3-input OR circuit 31k, and the runaway process is performed.

【0047】このように本実施例では、比較器(3−
1)→比較器(3−2)→比較器(3−3)→比較器
(3−4)の順で一致比較結果を示す信号が順序判定回
路31に出力されるか否かを判定することでCPU1の
暴走状態を検出することになり、また、従来のように本
来のプログラム中にクリア命令などを配置する必要がな
く、CPUに負担をかけることがなく、暴走状態を検出
するタイミングを任意に設定できると共に、暴走状態の
検出の際の応答性および暴走状態の検出精度を向上させ
ることが可能である。
As described above, in this embodiment, the comparator (3-
1) → comparator (3-2) → comparator (3-3) → comparator (3-4) in this order, it is determined whether or not a signal indicating the matching comparison result is output to the order determination circuit 31. As a result, the runaway state of the CPU 1 is detected, and it is not necessary to place a clear instruction or the like in the original program as in the conventional case, and the timing for detecting the runaway state is not imposed on the CPU. It can be set arbitrarily, and it is possible to improve the responsiveness at the time of detecting the runaway state and the accuracy of detecting the runaway state.

【0048】実施例4.以下、請求項4の発明の一実施
例を図について説明する。図8は、本実施例の暴走検出
回路の構成を示すブロック図である。図8において図6
と同一または相当の部分については同一の符号を付し説
明を省略する。図において41は比較器(3−1),
(3−2),(3−3),(3−4)から出力される比
較結果を示す信号の論理和を演算し、その演算結果を出
力する4入力OR回路である。42は命令コード識別信
号線であり、CPUが取り込もうとしているデータが命
令コードであるときにCPU1は‘L’レベルの命令コ
ード識別信号をこの命令コード識別信号線42に出力す
る。43は4入力OR回路41の出力と命令コード識別
信号線42に出力される命令コード識別信号との論理積
演算を行う2入力AND回路である。本実施例では、ア
ドレスレジスタ(5−1),(5−2),(5−3),
(5−4)に格納されるアドレスデータは、命令コード
を格納したメモリ1の記憶エリアのアドレスを示したも
のであり、CPU1のプログラム動作の初期において実
行される初期設定動作により設定される。
Example 4. An embodiment of the invention of claim 4 will be described below with reference to the drawings. FIG. 8 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. In FIG.
The same or corresponding parts are designated by the same reference numerals and the description thereof will be omitted. In the figure, 41 is a comparator (3-1),
It is a 4-input OR circuit that calculates the logical sum of the signals indicating the comparison results output from (3-2), (3-3), and (3-4), and outputs the calculation result. Reference numeral 42 is an instruction code identification signal line, and when the data that the CPU is going to fetch is an instruction code, the CPU 1 outputs an instruction code identification signal of the'L 'level to this instruction code identification signal line 42. Reference numeral 43 is a 2-input AND circuit that performs a logical product operation of the output of the 4-input OR circuit 41 and the instruction code identification signal output to the instruction code identification signal line 42. In this embodiment, the address registers (5-1), (5-2), (5-3),
The address data stored in (5-4) indicates the address of the storage area of the memory 1 in which the instruction code is stored, and is set by the initial setting operation executed at the beginning of the program operation of the CPU 1.

【0049】なお、比較器(3−1),(3−2),
(3−3),(3−4)と4入力OR回路41と2入力
AND回路43は命令コード判定回路に対応している。
The comparators (3-1), (3-2),
The (3-3), (3-4), the 4-input OR circuit 41, and the 2-input AND circuit 43 correspond to the instruction code determination circuit.

【0050】次に動作について説明する。CPU1が正
常動作を行っているときにアドレスレジスタ(5−
1),(5−2),(5−3),(5−4)に格納され
るアドレスデータが示すメモリ2のアドレスがアクセス
されると、これらアドレスの示す記憶エリアから命令コ
ードがデータ信号線10に読み出される。このときCP
U1は‘L’レベルの命令コード識別信号を命令コード
識別信号線42に出力する結果、2入力AND回路43
からは‘H’レベルの暴走検出信号が出力されることは
ない。
Next, the operation will be described. When the CPU 1 is operating normally, the address register (5-
1), (5-2), (5-3), (5-4), when the address of the memory 2 indicated by the address data stored is accessed, the instruction code is a data signal from the storage area indicated by these addresses. Read out on line 10. CP at this time
U1 outputs the'L 'level instruction code identification signal to the instruction code identification signal line 42, and as a result, the 2-input AND circuit 43
Does not output an "H" level runaway detection signal.

【0051】また、CPU1が暴走するとCPU1のプ
ログラム動作は混乱して異常動作を行うことになり、ア
ドレスレジスタ(5−1),(5−2),(5−3),
(5−4)に格納されたアドレスデータが示すメモリ2
のアドレスのアクセスが行われても、このときデータ信
号線10に出力されるデータは命令コードではない数値
データや無意味なデータなどであることが考えられる。
このためCPU1から命令コード識別信号線42へ出力
される命令コード識別信号は‘H’レベルとなり、2入
力AND回路43からは‘H’レベルの暴走検出信号が
出力されることになり、暴走処理部8により暴走処理が
行われる。
When the CPU 1 runs out of control, the program operation of the CPU 1 is confused and an abnormal operation is performed, and the address registers (5-1), (5-2), (5-3),
Memory 2 indicated by the address data stored in (5-4)
Even if the address is accessed, the data output to the data signal line 10 at this time may be numeric data that is not an instruction code or meaningless data.
Therefore, the instruction code identification signal output from the CPU 1 to the instruction code identification signal line 42 becomes the “H” level, and the two-input AND circuit 43 outputs the “H” level runaway detection signal. The runaway process is performed by the unit 8.

【0052】このように本実施例によれば、アドレスレ
ジスタにより夫々設定された複数のアドレスが示すメモ
リ2の記憶エリアに格納されている命令コードが夫々正
常に読み出されているか否かを判定することでCPU1
の暴走状態を検出するため、従来のように本来のプログ
ラム中にクリア命令などを配置する必要がなく、CPU
に負担をかけることがなく、暴走状態を検出するタイミ
ングを任意に設定できると共に、暴走状態の検出の際の
応答性および暴走状態の検出精度を向上させることが可
能である。
As described above, according to this embodiment, it is determined whether or not the instruction code stored in the storage area of the memory 2 indicated by the plurality of addresses respectively set by the address register is normally read. By doing CPU1
Since the runaway state of the CPU is detected, it is not necessary to place a clear instruction in the original program as in the conventional case,
It is possible to arbitrarily set the timing for detecting the runaway state without imposing a burden on the CPU, and to improve the responsiveness at the time of detecting the runaway state and the accuracy of detecting the runaway state.

【0053】実施例5.以下、請求項5の発明の一実施
例を図について説明する。図9は、本実施例の暴走検出
回路の構成を示すブロック図である。図9において図1
と同一または相当の部分については同一の符号を付し説
明を省略する。図において51と52は比較器であり、
比較器51はアドレス信号線9に出力されるアドレスデ
ータAとアドレスレジスタ53に格納されたアドレスデ
ータBとの比較を行い、アドレスデータA>アドレスデ
ータBのときには比較結果出力端子Y0に‘H’レベル
の信号を出力し、またアドレスデータA<アドレスデー
タBのときには比較結果出力端子Y1に‘H’レベルの
信号を出力する。比較器52も同様な機能を有してい
る。55は比較器51と比較器52とから夫々出力され
る信号の論理積を演算し、その演算結果を出力する2入
力AND回路である。2入力AND回路55の出力は3
入力AND回路57の入力端子の一つに供給されると共
に、CPU1にも供給されるように構成されている。
Example 5. An embodiment of the invention of claim 5 will be described below with reference to the drawings. FIG. 9 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. In FIG. 9, FIG.
The same or corresponding parts are designated by the same reference numerals and the description thereof will be omitted. In the figure, 51 and 52 are comparators,
The comparator 51 compares the address data A output to the address signal line 9 with the address data B stored in the address register 53. When address data A> address data B, the comparison result output terminal Y0 is'H '. A level signal is output, and when address data A <address data B, an'H 'level signal is output to the comparison result output terminal Y1. The comparator 52 also has a similar function. Reference numeral 55 is a two-input AND circuit that calculates the logical product of the signals output from the comparator 51 and the comparator 52 and outputs the calculation result. The output of the 2-input AND circuit 55 is 3
It is configured to be supplied to one of the input terminals of the input AND circuit 57 and also supplied to the CPU 1.

【0054】56は比較データレジスタであり、比較器
58においてデータ信号線10上に出力されたデータ値
が期待されるデータ値であるか否かを判定するための期
待値が格納される。本実施例では、この期待値は「F
F」に設定されている。また比較器58は図1に示す比
較器4と同様な機能を備えている。59はCPU1から
データチェック信号が出力されるデータチェック信号線
であり、CPU1は2入力AND回路55から出力され
る信号からデータチェックを行うエリアであることを知
ると、このエリア内の命令コードの次ぎのデータを取り
込む際にそのデータがチェックすべきデータであること
を示す‘H’レベルのデータチェック信号をデータチェ
ック信号線59に出力する。
Reference numeral 56 is a comparison data register, which stores an expected value for determining whether or not the data value output on the data signal line 10 in the comparator 58 is an expected data value. In this embodiment, this expected value is "F
It is set to "F". Further, the comparator 58 has the same function as the comparator 4 shown in FIG. Reference numeral 59 is a data check signal line from which a data check signal is output from the CPU 1, and when the CPU 1 knows that it is an area for performing data check from the signal output from the 2-input AND circuit 55, the instruction code in this area When the next data is taken in, an'H 'level data check signal indicating that the data is to be checked is output to the data check signal line 59.

【0055】アドレスレジスタ53,54に格納される
アドレスデータと比較データレジスタ56に格納される
期待値は、CPU1のプログラム動作の初期において実
行される初期設定動作により設定される。
The address data stored in the address registers 53 and 54 and the expected value stored in the comparison data register 56 are set by the initial setting operation executed at the beginning of the program operation of the CPU 1.

【0056】図10は比較器51の構成を示すブロック
図であり、51a,51b,51c,51d,51eは
アドレス信号線9上に出力されたアドレスデータAとア
ドレスレジスタ53に格納されたアドレスデータBの各
ビット毎の比較を行う1ビット比較器である。51fと
51gはインバータ回路である。
FIG. 10 is a block diagram showing the configuration of the comparator 51. 51a, 51b, 51c, 51d and 51e are address data A output on the address signal line 9 and address data stored in the address register 53. It is a 1-bit comparator that compares each bit of B. 51f and 51g are inverter circuits.

【0057】図11は図10に示した1ビット比較器、
たとえば1ビット比較器51aの構成を示す論理回路図
である。なお、他の1ビット比較器も同様な回路構成で
ある。図において61は上位の1ビット比較器のアドレ
スデータAとアドレスデータBとの1ビットの大小関係
についての比較結果(アドレスデータA>アドレスデー
タB)が出力される比較結果信号線、62は同様に比較
結果(A<B)が出力される比較結果信号線、63は同
様に比較結果(A=B)が出力される比較結果信号線で
ある。64はアドレスデータAの1ビット分のデータが
出力される比較アドレスデータビット信号線、65は前
記アドレスデータAと同一桁のアドレスデータBの1ビ
ット分のデータが出力される比較アドレスデータビット
信号線である。
FIG. 11 shows the 1-bit comparator shown in FIG.
For example, it is a logic circuit diagram showing a configuration of a 1-bit comparator 51a. The other 1-bit comparators have the same circuit configuration. In the figure, reference numeral 61 is a comparison result signal line for outputting the comparison result (address data A> address data B) regarding the 1-bit magnitude relationship between the address data A and the address data B of the upper 1-bit comparator, and 62 is the same. Is a comparison result signal line for outputting the comparison result (A <B), and 63 is a comparison result signal line for similarly outputting the comparison result (A = B). Reference numeral 64 is a comparison address data bit signal line for outputting 1-bit data of the address data A, and 65 is a comparison address data bit signal for outputting 1-bit data of the address data B having the same digit as the address data A. It is a line.

【0058】66はアドレスデータAとアドレスデータ
Bとの一致演算結果を反転して出力するexNOR回
路、67はアドレスデータBを反転するインバータ回
路、68はアドレスデータAを反転するインバータ回
路、69と70は3入力AND回路、71は2入力AN
D回路、72は上位の比較器の比較結果(A>B)と3
入力AND回路69の出力との論理和演算を行い、その
演算結果を出力する2入力OR回路、73は上位の比較
器の比較結果(A<B)と3入力AND回路70の出力
との論理和演算を行い、その演算結果を出力する2入力
OR回路である。74は2入力OR回路72の演算結果
を比較結果出力端子(A>BOUT)へ出力する比較結
果出力信号線、75は2入力OR回路73の演算結果を
比較結果出力端子(A<BOUT)へ出力する比較結果
出力信号線、76は2入力AND回路71の演算結果を
比較結果出力端子(A=BOUT)へ出力する比較結果
出力信号線である。
Reference numeral 66 designates an exNOR circuit which inverts and outputs the coincidence operation result of the address data A and address data B, 67 an inverter circuit which inverts the address data B, 68 an inverter circuit which inverts the address data A, and 69 70 is a 3-input AND circuit, 71 is a 2-input AN
D circuit, 72 is a comparison result (A> B) of the upper comparator and 3
A 2-input OR circuit which performs a logical sum operation with the output of the input AND circuit 69 and outputs the operation result, and 73 is a logic between the comparison result (A <B) of the upper comparator and the output of the 3-input AND circuit 70. A two-input OR circuit that performs a sum operation and outputs the operation result. 74 is a comparison result output signal line for outputting the operation result of the 2-input OR circuit 72 to the comparison result output terminal (A> BOUT), and 75 is the operation result of the 2-input OR circuit 73 to the comparison result output terminal (A <BOUT). A comparison result output signal line for outputting, and a comparison result output signal line for outputting the operation result of the 2-input AND circuit 71 to the comparison result output terminal (A = BOUT).

【0059】なお、図9におけるアドレスレジスタ5
3,54はアドレス範囲設定手段に対応し、比較データ
レジスタ56はデータ値設定手段に対応し、3入力AN
D回路57と比較器58はチェックデータ判定回路に対
応し、CPU1はアドレス範囲設定手段およびデータ値
設定手段に対応している。
The address register 5 shown in FIG.
Reference numerals 3 and 54 correspond to the address range setting means, and the comparison data register 56 corresponds to the data value setting means.
The D circuit 57 and the comparator 58 correspond to the check data judging circuit, and the CPU 1 corresponds to the address range setting means and the data value setting means.

【0060】次に動作について説明する。CPU1が正
常に動作していると、アドレス信号線9に出力されるア
ドレス値がアドレスレジスタ53に格納されたアドレス
データの値とアドレスレジスタ54に格納されたアドレ
スデータの値との範囲に含まれる場合に限り、2入力A
ND回路55の出力は‘H’レベルとなる。CPU1は
2入力AND回路55の出力が‘H’レベルになったこ
とからデータチェックを行うエリアを知り、このエリア
内の命令コードの次ぎのデータを取り込む際にそのデー
タがチェックすべきデータであることを示す‘H’レベ
ルのデータチェック信号をデータチェック信号線59に
出力する。また、比較器58は、比較データレジスタ5
6に格納されている期待値とデータ信号線10上に出力
されるデータとを比較し、一致すると‘L’レベルの信
号を比較結果出力端子YBから3入力AND回路57へ
出力する。
Next, the operation will be described. When the CPU 1 is operating normally, the address value output to the address signal line 9 is included in the range between the value of the address data stored in the address register 53 and the value of the address data stored in the address register 54. 2 inputs A only if
The output of the ND circuit 55 becomes'H 'level. Since the output of the 2-input AND circuit 55 is at the "H" level, the CPU 1 knows the area for data check, and that data is the data to be checked when fetching the data next to the instruction code in this area. An “H” level data check signal indicating that is output to the data check signal line 59. Further, the comparator 58 includes the comparison data register 5
The expected value stored in 6 is compared with the data output on the data signal line 10, and if they match, a signal of'L 'level is output from the comparison result output terminal YB to the 3-input AND circuit 57.

【0061】従って、CPU1が正常動作を行っており
アドレスレジスタ53,54に格納されたアドレスデー
タの値により規定されるアドレス範囲内の命令コードの
次ぎのデータが比較データレジスタ56に格納された期
待値と一致する限り、3入力AND回路57の出力は
‘H’レベルとはならず、暴走処理が行われることはな
い。
Therefore, it is expected that the CPU 1 is operating normally and the data next to the instruction code within the address range defined by the value of the address data stored in the address registers 53 and 54 is stored in the comparison data register 56. As long as it matches the value, the output of the 3-input AND circuit 57 does not become the “H” level, and the runaway process is not performed.

【0062】またCPU1が暴走状態になると、CPU
1のプログラム動作は混乱して異常動作を行うことにな
り、アドレスレジスタ53,54に格納されたアドレス
データの値により規定される範囲内の命令コードの次ぎ
のデータが比較データレジスタ56に格納された期待値
と一致しなくなると考えられる。従って、この状態では
‘H’レベルのデータチェック信号が出力されるタイミ
ングで3入力AND回路57の出力は‘H’レベルとな
り、暴走処理が行われる。
When the CPU 1 goes into a runaway state, the CPU
The program operation of No. 1 is confused and causes an abnormal operation, and the data next to the instruction code within the range defined by the value of the address data stored in the address registers 53 and 54 is stored in the comparison data register 56. It is thought that it will not match the expected value. Therefore, in this state, the output of the 3-input AND circuit 57 becomes the "H" level at the timing when the "H" level data check signal is output, and the runaway process is performed.

【0063】このように本実施例によれば、アドレスレ
ジスタ53,54に格納されたアドレスデータの値によ
り規定されるアドレス範囲内の命令コードの次ぎのデー
タが比較データレジスタ56に格納された期待値と一致
するか否かを判定し、CPU1の暴走状態を検出するの
で、暴走状態を検出するタイミングを任意に設定する際
の設定精度やデータのある一部分について発生した他に
重大な影響を及ぼすことのない軽微な暴走に対する検出
精度をCPUに負担をかけることなく向上させることが
可能である。
As described above, according to the present embodiment, the data next to the instruction code within the address range defined by the values of the address data stored in the address registers 53 and 54 is expected to be stored in the comparison data register 56. Since it determines whether or not it matches the value and detects the runaway state of the CPU 1, it has a significant influence on the setting accuracy when arbitrarily setting the timing for detecting the runaway state and on the occurrence of a part of the data. It is possible to improve the detection accuracy for a slight runaway without a load on the CPU.

【0064】実施例6.以下、請求項6の発明の一実施
例を図について説明する。図12は、本実施例の暴走検
出回路の構成を示すブロック図である。図12において
図9と同一または相当の部分については同一の符号を付
し説明を省略する。図において81はデータ信号線10
上に出力された8ビットの命令コードデータと比較命令
コード設定レジスタ83に格納された命令コードとの比
較を行う比較器であり、比較器51,52と同様に構成
されている。82はデータ信号線10上に出力された8
ビットの命令コードデータと比較命令コード設定レジス
タ84に格納された命令コードとの比較を行う比較器で
あり、比較器51,52と同様に構成されている。本実
施例では、比較命令コード設定レジスタ83には命令コ
ード「F0」が格納され、また比較命令コード設定レジ
スタ84には命令コード「10」が格納され、これら命
令コードとアドレスレジスタ53,54に格納されるア
ドレスデータは、CPU1のプログラム動作の初期にお
いて実行される初期設定動作により夫々書き込まれ格納
される。また、比較命令コード設定レジスタ83,84
に書き込まれる命令コードにより規定される範囲は、ア
ドレスレジスタ53,54のアドレスデータの値により
規定されるアドレス範囲がアクセスされたときにCPU
1の正常動作によっては決して使用されることのない命
令コードの範囲を示す。
Example 6. An embodiment of the invention of claim 6 will be described below with reference to the drawings. FIG. 12 is a block diagram showing the configuration of the runaway detection circuit of this embodiment. 12, parts that are the same as or correspond to those in FIG. 9 are assigned the same reference numerals and explanations thereof are omitted. In the figure, 81 is the data signal line 10.
This is a comparator that compares the 8-bit instruction code data output above and the instruction code stored in the comparison instruction code setting register 83, and is configured similarly to the comparators 51 and 52. 82 is output to the data signal line 10
The comparator is a comparator that compares the instruction code data of bits and the instruction code stored in the comparison instruction code setting register 84, and is configured similarly to the comparators 51 and 52. In this embodiment, the comparison instruction code setting register 83 stores the instruction code “F0”, the comparison instruction code setting register 84 stores the instruction code “10”, and these instruction codes and the address registers 53 and 54. The stored address data is written and stored by the initial setting operation executed at the initial stage of the program operation of the CPU 1. Further, the comparison instruction code setting registers 83 and 84
The range defined by the instruction code written in the CPU is the CPU when the address range defined by the value of the address data of the address registers 53 and 54 is accessed.
1 shows a range of instruction codes that are never used by normal operation.

【0065】85は比較器81と比較器82の比較結果
の論理和演算を行い、その演算結果を出力する2入力O
R回路、86はCPU1が命令コードを取り込むときに
‘L’レベルの命令コード識別信号が出力される命令コ
ード識別信号線である。87は命令コード識別信号を反
転するインバータ回路、88は2入力AND回路55の
出力と2入力OR回路85の出力とインバータ回路87
の出力の論理積演算を行い、その演算結果を出力する3
入力AND回路である。
Reference numeral 85 is a 2-input O which performs a logical sum operation of the comparison results of the comparator 81 and the comparator 82 and outputs the operation result.
The R circuit 86 is an instruction code identification signal line through which an instruction code identification signal of the'L 'level is output when the CPU 1 fetches the instruction code. 87 is an inverter circuit that inverts the instruction code identification signal, 88 is the output of the 2-input AND circuit 55, the output of the 2-input OR circuit 85, and the inverter circuit 87.
ANDs the output of and outputs the operation result 3
It is an input AND circuit.

【0066】なお、CPU1と比較命令コード設定レジ
スタ83,84は命令コード設定手段に対応し、比較器
81,82と3入力AND回路88は命令コード範囲判
定回路に対応している。
The CPU 1 and the comparison instruction code setting registers 83 and 84 correspond to the instruction code setting means, and the comparators 81 and 82 and the 3-input AND circuit 88 correspond to the instruction code range determination circuit.

【0067】次に動作について説明する。CPU1が正
常に動作しているときには、アドレスレジスタ53,5
4のアドレスデータの値により規定されるアドレス範囲
の命令コード、すなわち比較命令コード設定レジスタ8
3,84に書き込まれる命令コードにより規定される範
囲の命令コードは使用されることがないので、アドレス
レジスタ53,54のアドレスデータの値により規定さ
れる範囲のアドレスデータがアドレス信号線9上に出力
されたときのデータ信号線10上に出力される命令コー
ドには、比較命令コード設定レジスタ83,84に書き
込まれている命令コードにより規定される範囲の命令コ
ードは含まれていないので、比較器81の比較結果出力
端子Y0からは‘H’レベルの信号は出力されず、また
比較器82の比較結果出力端子Y1からも‘H’レベル
の信号は出力されないので2入力OR回路85の出力は
‘L’レベルとなり、3入力AND回路88の出力は
‘H’レベルになることはなく暴走処理は実行されな
い。
Next, the operation will be described. When the CPU 1 is operating normally, the address registers 53, 5
The instruction code in the address range defined by the value of the address data of 4, that is, the comparison instruction code setting register 8
Since the instruction code in the range defined by the instruction code written in 3, 84 is not used, the address data in the range defined by the value of the address data in the address registers 53, 54 is placed on the address signal line 9. The instruction code output on the data signal line 10 at the time of output does not include the instruction code in the range defined by the instruction codes written in the comparison instruction code setting registers 83 and 84. Since the comparison result output terminal Y0 of the comparator 81 does not output an "H" level signal, and the comparison result output terminal Y1 of the comparator 82 does not output an "H" level signal, the output of the 2-input OR circuit 85 is output. Becomes "L" level, the output of the 3-input AND circuit 88 does not become "H" level, and the runaway process is not executed.

【0068】一方、CPU1が暴走状態になると、アド
レスレジスタ53,54のアドレスデータの値により規
定されるアドレス範囲の命令コード、すなわち比較命令
コード設定レジスタ83,84に書き込まれている命令
コードにより規定される範囲の命令コードがデータ信号
線上に出力される場合が生ずると考えられる。従って、
この状態を検出することでCPUが暴走したと判定す
る。すなわち、CPU1が暴走状態に陥ってアドレスレ
ジスタ53,54のアドレスデータの値により規定され
るアドレス範囲の命令コード、すなわち比較命令コード
設定レジスタ83,84に書き込まれる命令コードによ
り規定される範囲の命令コードがメモリ2から読み出さ
れると、この命令コードはデータ信号線10に出力され
る。データ信号線10に出力される本来使用されてはい
けない命令コードは、比較器81と比較器82により比
較命令コード設定レジスタ83,84に格納された命令
コードと大小関係が比較されることで検出され、‘H’
レベルの信号が2入力OR回路85に出力される。また
このときCPU1からは‘L’レベルの命令コード識別
信号が出力され、インバータ回路87により反転され
‘H’レベルの命令コード識別信号として3入力AND
回路88に出力される。この結果、3入力AND回路8
8からは‘H’レベルの暴走検出信号が出力され、暴走
処理が実行される。
On the other hand, when the CPU 1 goes into a runaway state, it is defined by the instruction code in the address range defined by the value of the address data of the address registers 53, 54, that is, the instruction code written in the comparison instruction code setting registers 83, 84. It is conceivable that an instruction code in the range specified may be output on the data signal line. Therefore,
It is determined that the CPU has runaway by detecting this state. That is, the CPU 1 falls into a runaway state and the instruction code in the address range defined by the value of the address data in the address registers 53, 54, that is, the instruction in the range defined by the instruction code written in the comparison instruction code setting registers 83, 84. When the code is read from the memory 2, this instruction code is output to the data signal line 10. The instruction code output to the data signal line 10, which should not be used originally, is detected by comparing the instruction code stored in the comparison instruction code setting registers 83 and 84 by the comparator 81 and the comparator 82 with each other. Is'H '
The level signal is output to the 2-input OR circuit 85. At this time, the CPU 1 outputs an “L” level instruction code identification signal, which is inverted by the inverter circuit 87 and used as a “H” level instruction code identification signal by a 3-input AND.
It is output to the circuit 88. As a result, the 3-input AND circuit 8
A runaway detection signal of'H 'level is output from 8 and the runaway process is executed.

【0069】このように本実施例によれば、CPU1が
暴走状態に陥ってアドレスレジスタ53,54のアドレ
スデータの値により規定されるアドレス範囲の命令コー
ド、すなわち比較命令コード設定レジスタ83,84に
書き込まれる命令コードにより規定される範囲の命令コ
ードが読み出されたか否かを判定することで、CPU1
の暴走状態を検出するので、命令コードについての暴走
状態の検出のタイミングをCPUに負担をかけることな
く幅を有して設定することが可能となる。
As described above, according to the present embodiment, the CPU 1 falls into the runaway state and the instruction code in the address range defined by the value of the address data of the address registers 53 and 54, that is, the comparison instruction code setting registers 83 and 84, is stored. By determining whether or not the instruction code within the range defined by the written instruction code is read, the CPU 1
Since the runaway state is detected, it is possible to set the timing of detecting the runaway state for the instruction code with a range without burdening the CPU.

【0070】なお以上説明した実施例では、比較命令コ
ード設定レジスタ83,84に書き込まれる命令コード
により規定される範囲は、アドレスレジスタ53,54
のアドレスデータの値により規定されるアドレス範囲が
アクセスされたときにCPU1の正常動作によっては決
して使用されることのない命令コードの範囲を示すよう
に構成したが、比較命令コード設定レジスタ83,84
に書き込まれている命令コードにより規定される範囲
を、アドレスレジスタ53,54のアドレスデータの値
により規定されるアドレス範囲がアクセスされたときに
CPU1の正常動作により使用されなければならない命
令コードの範囲とするように構成してもよい。
In the embodiment described above, the range defined by the instruction codes written in the comparison instruction code setting registers 83, 84 is the address registers 53, 54.
When the address range defined by the value of the address data is accessed, the instruction code range that is never used by the normal operation of the CPU 1 is shown.
The range defined by the instruction code written in is the range of the instruction code that must be used by the normal operation of the CPU 1 when the address range defined by the address data values of the address registers 53 and 54 is accessed. May be configured as follows.

【0071】[0071]

【発明の効果】以上のように、請求項1の発明によれ
ば、CPUによりアクセスされる記憶部の任意のアドレ
スおよびそのアドレスがアクセスされたときのデータバ
ス上に出力されるデータに対する期待値を設定する設定
手段と、前記CPUが前記アドレスをアクセスしたとき
の前記データバス上に実際に出力されるデータと前記設
定手段により設定された期待値との一致を判定すること
で前記CPUの暴走状態を判定するように構成したの
で、暴走状態を検出するタイミングを任意に設定できる
と共に、CPUの負担の増加を招来しない暴走検出回路
が得られる効果がある。
As described above, according to the first aspect of the invention, an expected value for an arbitrary address of a storage unit accessed by the CPU and data output on the data bus when the address is accessed. And a runaway of the CPU by determining a match between data actually output on the data bus when the CPU accesses the address and an expected value set by the setting means. Since the state is determined, the timing for detecting the runaway state can be arbitrarily set, and a runaway detection circuit that does not increase the load on the CPU can be obtained.

【0072】請求項2の発明によればCPUによりアク
セスされる記憶部の任意の複数のアドレスおよび前記複
数の夫々のアドレスがアクセスされたときにデータバス
上に夫々出力されるデータとそれらデータに対する期待
値とを基に、CPUの動作を直接監視して暴走状態を検
出できるように構成したので、暴走状態を検出するタイ
ミングを任意に設定できると共に、暴走状態を検出する
際の応答性を向上させ、暴走状態の検出の際の信頼性を
向上させた暴走検出回路が得られる効果がある。
According to the second aspect of the present invention, a plurality of arbitrary addresses of the storage unit accessed by the CPU and the data respectively output on the data bus when the plurality of addresses are accessed and the corresponding data The CPU is configured to detect the runaway state by directly monitoring the CPU operation based on the expected value, so the timing to detect the runaway state can be set arbitrarily and the responsiveness when detecting the runaway state is improved. Thus, there is an effect that a runaway detection circuit with improved reliability in detecting a runaway state can be obtained.

【0073】請求項3の発明によればCPUによりアク
セスされる記憶部の任意の複数のアドレスを設定するア
ドレス設定手段と、該アドレス設定手段により設定され
たアドレスに対するアクセスが所定の順で実行されてい
るか否かを判断することで前記CPUの暴走状態を判定
する順序判定回路とを備えるように構成したので、暴走
状態を検出するタイミングを任意に設定できると共に、
暴走状態の検出の際の応答性および暴走状態の検出精度
を向上させることのできる暴走検出回路が得られる効果
がある。
According to the third aspect of the present invention, the address setting means for setting a plurality of arbitrary addresses of the storage unit accessed by the CPU, and the addresses set by the address setting means are accessed in a predetermined order. Since it is configured to include an order determination circuit that determines the runaway state of the CPU by determining whether or not the runaway state is detected, the timing for detecting the runaway state can be set arbitrarily, and
There is an effect that a runaway detection circuit that can improve the response at the time of detecting the runaway state and the accuracy of detecting the runaway state can be obtained.

【0074】請求項4の発明によればCPUによりアク
セスされる記憶部の命令コードを記憶した任意のアドレ
スを設定するアドレス設定手段と、該アドレス設定手段
により設定されたアドレスがアクセスされたときの前記
CPUが取り込むデータが命令コードであるか否かを判
断することで前記CPUの暴走状態を判定する命令コー
ド判定回路とを備え、CPUの動作を直接監視して暴走
状態を検出するように構成したので、暴走状態の検出の
際の応答性および暴走状態の検出精度を向上させること
のできる暴走検出回路が得られる効果がある。
According to the fourth aspect of the present invention, the address setting means for setting an arbitrary address storing the instruction code of the storage unit accessed by the CPU, and the address set by the address setting means are accessed. An instruction code determination circuit for determining the runaway state of the CPU by determining whether or not the data taken in by the CPU is an instruction code, and is configured to detect the runaway state by directly monitoring the operation of the CPU. Therefore, there is an effect that a runaway detection circuit capable of improving the responsiveness at the time of detecting the runaway state and the detection accuracy of the runaway state can be obtained.

【0075】請求項5の発明によればCPUによりアク
セスされる記憶部の任意のアドレス範囲を設定するアド
レス範囲設定手段と、該アドレス範囲設定手段により設
定されたアドレス範囲がアクセスされたときのそのアド
レス範囲に含まれる命令コードの次ぎのデータ値を設定
するデータ値設定手段と、前記アドレス範囲がアクセス
されたときに取り込まれる命令コードの次ぎのデータ値
が前記データ値設定手段により設定されたデータ値であ
るか否かを判断することで前記CPUの暴走状態を判定
するチェックデータ判定回路とを備え、CPUの動作を
直接監視して暴走状態を検出するように構成したので、
CPUに負担をかけることなく暴走状態を検出するタイ
ミングを設定する際の設定精度を向上させることのでき
る暴走検出回路が得られる効果がある。
According to the invention of claim 5, an address range setting means for setting an arbitrary address range of the storage unit accessed by the CPU, and an address range setting means for accessing the address range set by the address range setting means Data value setting means for setting the next data value of the instruction code included in the address range, and data set by the data value setting means for the next data value of the instruction code fetched when the address range is accessed. Since it has a check data judging circuit for judging the runaway state of the CPU by judging whether it is a value or not, and is configured to detect the runaway state by directly monitoring the operation of the CPU,
There is an effect that a runaway detection circuit that can improve the setting accuracy when setting the timing for detecting the runaway state without imposing a load on the CPU is obtained.

【0076】請求項6の発明によればCPUによりアク
セスされる記憶部の任意のアドレス範囲を設定するアド
レス範囲設定手段と、該アドレス範囲設定手段により設
定されたアドレス範囲がアクセスされたときのデータバ
ス上に出力される、もしくは出力されることのない命令
コードの範囲を設定する命令コード設定手段と、前記ア
ドレス範囲がアクセスされたときに前記CPUに取り込
まれる命令コードが前記命令コード設定手段により設定
された範囲の命令コードであるか否かを判断することで
前記CPUの暴走状態を判定する命令コード範囲判定回
路とを備え、CPUの動作を直接監視して暴走状態を検
出するように構成したので、暴走状態の検出の際のタイ
ミングをある幅を有して任意に設定できる暴走検出回路
が得られる効果がある。
According to the invention of claim 6, address range setting means for setting an arbitrary address range of the storage section accessed by the CPU, and data when the address range set by the address range setting means is accessed. The instruction code setting means for setting the range of the instruction code output on the bus or not output, and the instruction code fetched by the CPU when the address range is accessed by the instruction code setting means. An instruction code range determination circuit for determining the runaway state of the CPU by determining whether or not the instruction code is within a set range, and is configured to detect the runaway state by directly monitoring the operation of the CPU. Therefore, there is an effect that a runaway detection circuit can be obtained which has a certain width and can set the timing when the runaway state is detected. That.

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

【図1】 請求項1の発明の一実施例による暴走検出回
路を示すブロック図である。
FIG. 1 is a block diagram showing a runaway detection circuit according to an embodiment of the present invention.

【図2】 請求項1の発明の一実施例による暴走検出回
路のデータ信号線上に出力される8ビットデータを比較
する比較器の構成を示す論理回路図である。
FIG. 2 is a logic circuit diagram showing a configuration of a comparator for comparing 8-bit data output on a data signal line of a runaway detection circuit according to an embodiment of the invention of claim 1;

【図3】 請求項1の発明の一実施例による暴走検出回
路のアドレス信号線上に出力される16ビットのアドレ
スデータを比較する比較器の構成を示す論理回路図であ
る。
FIG. 3 is a logic circuit diagram showing a configuration of a comparator for comparing 16-bit address data output on the address signal line of the runaway detection circuit according to the first embodiment of the invention.

【図4】 請求項1の発明の一実施例による暴走検出回
路のデータ信号線上に出力される8ビットデータを比較
するために使用されるデータレジスタの構成を示す論理
回路図である。
FIG. 4 is a logic circuit diagram showing a configuration of a data register used for comparing 8-bit data output on a data signal line of the runaway detection circuit according to the embodiment of the invention of claim 1;

【図5】 請求項2の発明の一実施例による暴走検出回
路を示すブロック図である。
FIG. 5 is a block diagram showing a runaway detection circuit according to an embodiment of the invention of claim 2;

【図6】 請求項3の発明の一実施例による暴走検出回
路を示すブロック図である。
FIG. 6 is a block diagram showing a runaway detection circuit according to an embodiment of the present invention.

【図7】 請求項3の発明の一実施例による暴走検出回
路の順序判定回路を示す論理回路図である。
FIG. 7 is a logic circuit diagram showing an order determination circuit of a runaway detection circuit according to an embodiment of the invention of claim 3;

【図8】 請求項4の発明の一実施例による暴走検出回
路を示すブロック図である。
FIG. 8 is a block diagram showing a runaway detection circuit according to an embodiment of the invention of claim 4;

【図9】 請求項5の発明の一実施例による暴走検出回
路を示すブロック図である。
FIG. 9 is a block diagram showing a runaway detection circuit according to an embodiment of the invention of claim 5;

【図10】 請求項5の発明の一実施例による暴走検出
回路のアドレス信号線上に出力されるアドレスデータを
比較する比較器を示すブロック図である。
FIG. 10 is a block diagram showing a comparator for comparing address data output on an address signal line of a runaway detection circuit according to an embodiment of the invention of claim 5;

【図11】 請求項5の発明の一実施例による暴走検出
回路のアドレス信号線上に出力されるアドレスデータを
比較する比較器を構成する1ビット比較器を示す論理回
路図である。
FIG. 11 is a logic circuit diagram showing a 1-bit comparator which constitutes a comparator for comparing address data output on the address signal line of the runaway detection circuit according to the embodiment of the invention of claim 5;

【図12】 請求項6の発明の一実施例による暴走検出
回路を示すブロック図である。
FIG. 12 is a block diagram showing a runaway detection circuit according to an embodiment of the present invention.

【図13】 従来の暴走検出回路を示すブロック図であ
る。
FIG. 13 is a block diagram showing a conventional runaway detection circuit.

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

1 CPU(設定手段,アドレス設定手段,アドレス範
囲設定手段,データ値設定手段,命令コード設定手
段)、2 メモリ(記憶部)、3−1,3−2,3−
3,3−4 比較器,41 4入力OR回路,43 2
入力AND回路(命令コード判定回路)、3,4 比較
器,7 2入力AND回路(暴走判定回路)、5 アド
レスレジスタ,6 データレジスタ(設定手段)、5−
1,5−2,5−3,5−4 アドレスレジスタ(アド
レス設定手段)、9 アドレス信号線(アドレスバ
ス)、10 データ信号線(データバス)、31 順序
判定回路、53,54 アドレスレジスタ(アドレス範
囲設定手段)、56 比較データレジスタ(データ値設
定手段)、57 3入力AND回路,58 比較器(チ
ェックデータ判定回路)、83,84 比較命令コード
設定レジスタ(命令コード設定手段)、81,82比較
器,88 3入力AND回路(命令コード範囲判定回
路)。
1 CPU (setting means, address setting means, address range setting means, data value setting means, instruction code setting means) 2 memory (storage unit), 3-1, 3-2, 3-
3, 3-4 Comparator, 41 4 input OR circuit, 43 2
Input AND circuit (instruction code judgment circuit), 3, 4 comparator, 7 2-input AND circuit (runaway judgment circuit), 5 address register, 6 data register (setting means), 5-
1, 5-2, 5-3, 5-4 address register (address setting means), 9 address signal line (address bus), 10 data signal line (data bus), 31 sequence determination circuit, 53, 54 address register ( Address range setting means), 56 comparison data register (data value setting means), 57 3 input AND circuit, 58 comparator (check data determination circuit), 83, 84 comparison instruction code setting register (instruction code setting means), 81, 82 comparator, 88 3 input AND circuit (instruction code range determination circuit).

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 同一の半導体基板上にCPUと記憶部
と、前記CPUと記憶部とを接続するデータバスおよび
アドレスバスとを少なくとも構成したシングルチップマ
イクロコンピュータのプログラムに従わない暴走状態を
検出する暴走検出回路において、前記CPUによりアク
セスされる前記記憶部の任意のアドレスおよびそのアド
レスがアクセスされたときの前記データバス上に出力さ
れるデータに対する期待値を設定する設定手段と、前記
CPUが前記アドレスをアクセスしたときの前記データ
バス上に出力されるデータと前記設定手段により設定さ
れた期待値との一致を判断することで前記CPUの暴走
状態を判定する暴走判定回路とを備えたことを特徴とす
る暴走検出回路。
1. A runaway state that does not follow a program of a single-chip microcomputer including at least a CPU, a storage unit, and a data bus and an address bus connecting the CPU and the storage unit on the same semiconductor substrate is detected. In the runaway detection circuit, an arbitrary address of the storage unit accessed by the CPU and setting means for setting an expected value for data output on the data bus when the address is accessed; And a runaway determination circuit for determining the runaway state of the CPU by determining whether the data output on the data bus when the address is accessed matches the expected value set by the setting means. Characteristic runaway detection circuit.
【請求項2】 前記設定手段は、CPUによりアクセス
される記憶部の任意の複数のアドレスおよび前記複数の
夫々のアドレスがアクセスされたときにデータバス上に
夫々出力されるデータに対する期待値を設定することを
特徴とする請求項1記載の暴走検出回路。
2. The setting means sets an expected value for an arbitrary plurality of addresses of a storage unit accessed by a CPU and data output on a data bus when the plurality of addresses are accessed. The runaway detection circuit according to claim 1, wherein:
【請求項3】 同一の半導体基板上にCPUと記憶部
と、前記CPUと記憶部とを接続するデータバスおよび
アドレスバスとを少なくとも構成したシングルチップマ
イクロコンピュータのプログラムに従わない暴走状態を
検出する暴走検出回路において、前記CPUによりアク
セスされる前記記憶部の任意の複数のアドレスを設定す
るアドレス設定手段と、前記アドレス設定手段により設
定されたアドレスに対するアクセスが所定の順で実行さ
れているか否かを判断することで前記CPUの暴走状態
を判定する順序判定回路とを備えたことを特徴とする暴
走検出回路。
3. A runaway state that does not follow a program of a single-chip microcomputer including at least a CPU, a storage unit, and a data bus and an address bus connecting the CPU and the storage unit on the same semiconductor substrate is detected. In the runaway detection circuit, the address setting means for setting an arbitrary plurality of addresses of the storage section accessed by the CPU and whether or not the addresses set by the address setting means are accessed in a predetermined order. And a sequence determination circuit that determines the runaway state of the CPU by determining the runaway detection circuit.
【請求項4】 同一の半導体基板上にCPUと記憶部
と、前記CPUと記憶部とを接続するデータバスおよび
アドレスバスとを少なくとも構成したシングルチップマ
イクロコンピュータのプログラムに従わない暴走状態を
検出する暴走検出回路において、前記CPUによりアク
セスされる前記記憶部の命令コードを記憶した任意のア
ドレスを設定するアドレス設定手段と、該アドレス設定
手段により設定されたアドレスがアクセスされたときの
前記CPUが取り込むデータが命令コードであるか否か
を判断することで前記CPUの暴走状態を判定する命令
コード判定回路とを備えたことを特徴とする暴走検出回
路。
4. A runaway state that does not follow a program of a single-chip microcomputer including at least a CPU, a storage unit, and a data bus and an address bus connecting the CPU and the storage unit on the same semiconductor substrate is detected. In the runaway detection circuit, an address setting means for setting an arbitrary address storing the instruction code of the storage section accessed by the CPU, and the CPU when the address set by the address setting means is accessed A runaway detection circuit, comprising: an instruction code determination circuit for determining the runaway state of the CPU by determining whether or not the data is an instruction code.
【請求項5】 同一の半導体基板上にCPUと記憶部
と、前記CPUと記憶部とを接続するデータバスおよび
アドレスバスとを少なくとも構成したシングルチップマ
イクロコンピュータのプログラムに従わない暴走状態を
検出する暴走検出回路において、前記CPUによりアク
セスされる前記記憶部の任意のアドレス範囲を設定する
アドレス範囲設定手段と、該アドレス範囲設定手段によ
り設定されたアドレス範囲がアクセスされたときのその
アドレス範囲に含まれる命令コードの次ぎのデータ値を
設定するデータ値設定手段と、前記アドレス範囲がアク
セスされたときに取り込まれる命令コードの次ぎのデー
タ値が前記データ値設定手段により設定されたデータ値
であるか否かを判断することで前記CPUの暴走状態を
判定するチェックデータ判定回路とを備えたことを特徴
とする暴走検出回路。
5. A runaway state that does not follow a program of a single-chip microcomputer including at least a CPU, a storage unit, and a data bus and an address bus connecting the CPU and the storage unit on the same semiconductor substrate is detected. In the runaway detection circuit, address range setting means for setting an arbitrary address range of the storage section accessed by the CPU, and the address range set by the address range setting means is included in the address range when accessed. Data value setting means for setting the next data value of the instruction code to be read, and whether the data value next to the instruction code fetched when the address range is accessed is the data value set by the data value setting means. Check day to judge the runaway state of the CPU by judging whether or not A runaway detection circuit comprising a data determination circuit.
【請求項6】 同一の半導体基板上にCPUと記憶部
と、前記CPUと記憶部とを接続するデータバスおよび
アドレスバスとを少なくとも構成したシングルチップマ
イクロコンピュータのプログラムに従わない暴走状態を
検出する暴走検出回路において、前記CPUによりアク
セスされる前記記憶部の任意のアドレス範囲を設定する
アドレス範囲設定手段と、該アドレス範囲設定手段によ
り設定されたアドレス範囲がアクセスされたときの前記
データバス上に出力されるもしくは出力されることのな
い命令コードの範囲を設定する命令コード設定手段と、
前記アドレス範囲がアクセスされたときに前記CPUに
取り込まれる命令コードが前記命令コード設定手段によ
り設定された範囲の命令コードであるか否かを判断する
ことで前記CPUの暴走状態を判定する命令コード範囲
判定回路とを備えたことを特徴とする暴走検出回路。
6. A runaway state that does not follow a program of a single-chip microcomputer including at least a CPU, a storage unit, and a data bus and an address bus connecting the CPU and the storage unit on the same semiconductor substrate is detected. In the runaway detection circuit, an address range setting means for setting an arbitrary address range of the storage section accessed by the CPU and the data bus when the address range set by the address range setting means are accessed. Instruction code setting means for setting a range of instruction codes that are output or not output,
An instruction code for determining the runaway state of the CPU by determining whether the instruction code fetched by the CPU when the address range is accessed is within the range set by the instruction code setting means. A runaway detection circuit comprising a range determination circuit.
JP6147907A 1994-06-29 1994-06-29 Runaway detection device Pending JPH0816434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6147907A JPH0816434A (en) 1994-06-29 1994-06-29 Runaway detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6147907A JPH0816434A (en) 1994-06-29 1994-06-29 Runaway detection device

Publications (1)

Publication Number Publication Date
JPH0816434A true JPH0816434A (en) 1996-01-19

Family

ID=15440826

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6147907A Pending JPH0816434A (en) 1994-06-29 1994-06-29 Runaway detection device

Country Status (1)

Country Link
JP (1) JPH0816434A (en)

Cited By (3)

* 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
US8015457B2 (en) 2006-12-13 2011-09-06 Elpida Memory, Inc. Redundancy circuit and semiconductor memory device

Cited By (3)

* 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
US8015457B2 (en) 2006-12-13 2011-09-06 Elpida Memory, Inc. Redundancy circuit and semiconductor memory device

Similar Documents

Publication Publication Date Title
US6243804B1 (en) Single cycle transition pipeline processing using shadow registers
US5717851A (en) Breakpoint detection circuit in a data processor and method therefor
JP3242508B2 (en) Microcomputer
US5862148A (en) Microcontroller with improved debug capability for internal memory
US7243372B2 (en) Modified Harvard architecture processor having data memory space mapped to program memory space with erroneous execution protection
CN113228024A (en) Secure predictor for speculative execution
JPS6218936B2 (en)
JPH10333939A (en) Microprocessor
US6070218A (en) Interrupt capture and hold mechanism
US6463492B1 (en) Technique to automatically notify an operating system level application of a system management event
JPH0816434A (en) Runaway detection device
JP3590282B2 (en) Stop point interrupt generator for superscalar microprocessor
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
JPH0267979A (en) Testing circuit for logic circuit
JP5012562B2 (en) Microcomputer
JPH07262032A (en) Information processor
JPH11143732A (en) Microcomputer and emulator
JP4044455B2 (en) Debug support device
JP3129873B2 (en) Microcomputer
JPH0659921A (en) Microcomputer
JP2950080B2 (en) Microcomputer
JPH036758A (en) Microprocessor
JPH06139084A (en) Information processor
JPH0471218B2 (en)
JPH09106359A (en) Semiconductor integrated circuit