JPH05189258A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH05189258A
JPH05189258A JP4005347A JP534792A JPH05189258A JP H05189258 A JPH05189258 A JP H05189258A JP 4005347 A JP4005347 A JP 4005347A JP 534792 A JP534792 A JP 534792A JP H05189258 A JPH05189258 A JP H05189258A
Authority
JP
Japan
Prior art keywords
instruction
register
auxiliary
microcomputer
operation unit
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
JP4005347A
Other languages
Japanese (ja)
Inventor
Hiroshi Yoshii
浩 吉井
Ihei Sugimoto
維平 杉本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4005347A priority Critical patent/JPH05189258A/en
Publication of JPH05189258A publication Critical patent/JPH05189258A/en
Pending legal-status Critical Current

Links

Landscapes

  • Retry When Errors Occur (AREA)
  • Executing Machine-Instructions (AREA)
  • Hardware Redundancy (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To prevent runaway, and simultaneously, to improve the reliability of a system by automatically re-executing an instruction from starting before the generation of an error in the case the error is caused in a microcomputer because of an external noise, etc. CONSTITUTION:At the same time as the microcomputer 1 executes the instruction by an internal register 3 and an arithmetic logical part 6, an auxiliary register 4 and an auxiliary arithmetic logical part 7 emulate the instruction, and both results are compared with each other by a comparison circuit 9. Then, in the case that the error is caused, an interruption signal is generated through an interruption control circuit 10, and the contents of the register 3 just before the generation of the error copied beforehand in a monitor memory 5 are restored to the register 3 by this interruption signal. As the result, the instruction is re-executed while starting from the instruction just before the generation of the error.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、外来ノイズによる暴走
を防止するマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer for preventing runaway caused by external noise.

【0002】[0002]

【従来の技術】従来の一般的なマイクロコンピュータの
構成を図4に示す。同図において、マイクロコンピュー
タの内部を示すマイクロコンピュータ部1は、命令デコ
ーダ16、内部レジスタ3、演算論理部6、制御回路1
7等から構成されている。ここで、命令デコーダ16
は、外部メモリ及びI/O部15から、アドレスバス及
びデータバス2を介して符号化された命令を受け取って
解読すると共に、解読された命令は内部レジスタ3を介
し演算論理部6により実行される。制御回路17は、外
部メモリ及びI/O部15を制御バス8により制御す
る。また、内部レジスタ3には、累算機能を有するアキ
ュムレータ、プログラムが格納されているメモリ番地を
示すプログラムカウンタ、演算データの一時退避等に用
いられる汎用レジスタ等がある。このようにマイクロコ
ンピュータ部1は、アドレスバス及びデータバス2を介
して外部メモリ15からデータを入力し、内蔵されてい
る命令デコーダ16により命令を解読すると共に、この
解読された命令を内部レジスタ3及び演算論理部6等に
よって実行するようにしている。
2. Description of the Related Art The structure of a conventional general microcomputer is shown in FIG. In the figure, a microcomputer unit 1 showing the inside of the microcomputer includes an instruction decoder 16, an internal register 3, an arithmetic logic unit 6, and a control circuit 1.
It is composed of 7 etc. Here, the instruction decoder 16
Receives and decodes an encoded instruction from the external memory and I / O unit 15 via the address bus and the data bus 2, and the decoded instruction is executed by the arithmetic logic unit 6 via the internal register 3. It The control circuit 17 controls the external memory and the I / O unit 15 by the control bus 8. Further, the internal register 3 includes an accumulator having an accumulation function, a program counter indicating a memory address in which a program is stored, a general-purpose register used for temporarily saving operation data, and the like. As described above, the microcomputer unit 1 inputs data from the external memory 15 via the address bus and the data bus 2, decodes the instruction by the built-in instruction decoder 16, and decodes the decoded instruction in the internal register 3 And the arithmetic logic unit 6 and the like.

【0003】[0003]

【発明が解決しようとする課題】このようなマイクロコ
ンピュータにおいては、ノイズ等が到来した時には、割
り込みを用いてソフトウェア的に対処するかまたはハー
ドウェア的にリセットをかける等の方策により誤動作を
防止するようにしているため、その時点までに行われて
いた処理が中断されるという欠点があった。
In such a microcomputer, when noise or the like arrives, malfunction is prevented by taking measures such as software using interrupts or resetting by hardware. Therefore, there is a drawback that the processing that has been performed up to that point is interrupted.

【0004】[0004]

【課題を解決するための手段】このような課題を解決す
るために本発明は、マイクロコンピュータの命令実行時
に独立して命令を擬似実行(エミュレート)できるよう
にし、この結果を実際の命令実行の結果と照合すること
により、動作状況を監視すると共に、異常が検出された
場合には異常の発生直前の命令から再実行するようにし
たものである。
In order to solve such a problem, the present invention enables an instruction to be pseudo-executed (emulated) independently at the time of executing an instruction of a microcomputer, and the result is actually executed. The operation status is monitored by collating with the result of (1), and when an abnormality is detected, the instruction immediately before the abnormality is re-executed.

【0005】[0005]

【作用】本発明における補助レジスタには、マイクロコ
ンピュータ内部のレジスタの内容が複写されると共に、
補助演算論理部によりマイクロコンピュータ内部バスの
動作がエミュレートされ、さらに比較回路によって内部
レジスタの命令実行結果と上記エミュレート結果とが比
較される。そして、これらの結果が不一致であれば割り
込み制御回路から割り込み信号が発生し、この割り込み
信号によって既にモニタメモリに退避中の命令が内部レ
ジスタへ復帰される。この結果、異常が発生して各命令
結果が不一致となった場合には異常の発生直前の命令か
ら速やかに再実行される。
The contents of the internal register of the microcomputer are copied to the auxiliary register of the present invention, and
The auxiliary arithmetic logic unit emulates the operation of the microcomputer internal bus, and the comparison circuit compares the instruction execution result of the internal register with the emulation result. If these results do not match, an interrupt signal is generated from the interrupt control circuit, and the interrupt signal restores the instruction already saved in the monitor memory to the internal register. As a result, if an abnormality occurs and the results of the respective instructions do not match, the instruction immediately before the abnormality occurs is re-executed immediately.

【0006】[0006]

【実施例】以下、本発明について図面を参照して説明す
る。図1は、本発明に係るマイクロコンピュータの一実
施例を示すブロック図である。同図において、1はこの
マイクロコンピュータの内部を示すマイクロコンピュー
タ部、2はアドレスバス及びデータバス、3は内部レジ
スタ、4は内部レジスタ3を補助する補助レジスタ、5
は内部レジスタ3の内容を保存するためのモニタメモ
リ、6は命令を実行する演算論理部、7は演算論理部を
補助する補助演算論理部、9は演算論理部6及び補助演
算論理部7の演算結果を比較する比較回路、10は比較
回路9の比較結果により割り込みを発生させる割り込み
制御回路である。なお、制御バス8は割り込み発生信号
をモニタメモリ5へ伝達するためのものである。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a microcomputer according to the present invention. In the figure, 1 is a microcomputer unit showing the inside of this microcomputer, 2 is an address bus and data bus, 3 is an internal register, 4 is an auxiliary register for assisting the internal register 3, 5
Is a monitor memory for storing the contents of the internal register 3, 6 is an arithmetic logic unit for executing instructions, 7 is an auxiliary arithmetic logic unit for assisting the arithmetic logic unit, 9 is an arithmetic logic unit 6 and an auxiliary arithmetic logic unit 7. A comparison circuit 10 for comparing the operation results is an interrupt control circuit for generating an interrupt according to the comparison result of the comparison circuit 9. The control bus 8 is for transmitting the interrupt generation signal to the monitor memory 5.

【0007】次に、以上のように構成されたマイクロコ
ンピュータの動作について説明する。まず、マイクロコ
ンピュータは、演算処理部6を用いて命令を実行するに
先だって内部レジスタ3の内容を補助レジスタ4及びモ
ニタメモリ5に複写する。ここで、補助レジスタ4は、
命令の実行により変化する内部レジスタ3の内容の変化
を、補助演算論理部7を用いて補助レジスタ4の内容変
化としてエミュレート(模擬実行)する。命令実行後、
比較回路9を用いて内部レジスタ3の内容と補助レジス
タ4の内容とを比較し、双方の内容が等しいか否かを確
認する。そして双方の内容が異なっている場合には、何
らかの理由により内部レジスタ3または補助レジスタ4
の何れかにエラーが発生したと判断し、割り込み制御回
路10によりハードウェア割り込みをかけ、モニタメモ
リ5内に複写されているエラー発生直前の内部レジスタ
3の内容を内部レジスタ3へ復帰させる。この結果、エ
ラー発生直前の状態から命令が再実行される。
Next, the operation of the microcomputer configured as described above will be described. First, the microcomputer copies the contents of the internal register 3 to the auxiliary register 4 and the monitor memory 5 before executing the instruction using the arithmetic processing unit 6. Here, the auxiliary register 4 is
The change in the content of the internal register 3 which changes due to the execution of the instruction is emulated (simulated execution) as the change in the content of the auxiliary register 4 using the auxiliary arithmetic logic unit 7. After executing the command,
The comparison circuit 9 is used to compare the contents of the internal register 3 and the contents of the auxiliary register 4 to check whether the contents of the two are equal. If the contents of both are different, the internal register 3 or the auxiliary register 4 is for some reason.
It is determined that an error has occurred in any of the above, and the interrupt control circuit 10 issues a hardware interrupt to restore the contents of the internal register 3 copied in the monitor memory 5 immediately before the error occurs to the internal register 3. As a result, the instruction is re-executed from the state immediately before the error occurred.

【0008】次に、図2は、本発明の第2の実施例を示
すブロック図であり、同図に示すように、異常発生回数
を計数するカウンタ11を、比較回路9と割り込み制御
回路12との間に設けたものである。そして、このカウ
ンタ11により一定時間または一定数の命令を実行する
間に発生したエラーを計数すると共に、このカウント値
が予め設定した値よりも多くなった場合には、割り込み
制御回路12に上記したハードウェア割り込み信号とは
別個のハードウェア割り込み信号を発生させる。即ち、
このようなエラー多発時の場合には、割り込み制御回路
12は上記とは別個のハードウェア割り込みを発生して
実行中の処理を中止し例外処理ルーチンへ移行させる。
Next, FIG. 2 is a block diagram showing a second embodiment of the present invention. As shown in FIG. 2, a counter 11 for counting the number of abnormality occurrences, a comparator circuit 9 and an interrupt control circuit 12 are provided. It is provided between and. Then, the counter 11 counts the errors that have occurred during the execution of a certain time or a certain number of instructions, and when the count value exceeds a preset value, the interrupt control circuit 12 is instructed as described above. Generates a hardware interrupt signal that is separate from the hardware interrupt signal. That is,
When such an error occurs frequently, the interrupt control circuit 12 generates a hardware interrupt different from the above, interrupts the processing being executed, and shifts to the exception processing routine.

【0009】次に、図3は、上記マイクロコンピュータ
の第3の実施例を示すブロック図であり、これは上記第
2の実施例に示すカウンタ11に対しその値を設定する
ためのカウント値設定回路13を設けると共に、カウン
タ11へ設定された値をモニタできるカウント値モニタ
回路14を備えたものである。これらの回路を付加した
ことにより、ユーザの目的に応じてカウンタ11へのカ
ウンタ値を替えることが可能になると共に、この設定さ
れたカウント値を随時モニタできる。このように、ノイ
ズが到来し、内部のレジスタの値等が変動してマイクロ
コンピュータが暴走しても、これが完全に抑止できると
共に、レジスタの値の変動が偶発性のものか否かを容易
に判別することもできる。
Next, FIG. 3 is a block diagram showing a third embodiment of the microcomputer, which is a count value setting for setting the value to the counter 11 shown in the second embodiment. A circuit 13 is provided and a count value monitor circuit 14 capable of monitoring the value set in the counter 11 is provided. By adding these circuits, the counter value to the counter 11 can be changed according to the purpose of the user, and the set count value can be monitored at any time. In this way, even if noise comes and the value of the internal register fluctuates and the microcomputer runs out of control, this can be completely suppressed and it is easy to determine whether the fluctuation of the register value is an accidental one. It can also be determined.

【0010】[0010]

【発明の効果】以上説明したように、本発明によれば、
マイクロコンピュータの命令実行時に独立して命令を擬
似実行できるようにし、この結果を実際の命令実行の結
果と照合することにより、動作状況を監視すると共に、
異常が検出された場合には異常の発生直前の命令から再
実行するようにしたので、ノイズ等の到来により異常が
発生しても直ちに処理の再開が可能になる。
As described above, according to the present invention,
The instruction can be pseudo-executed independently at the time of executing the instruction of the microcomputer, and the operation status is monitored by comparing the result with the result of the actual instruction execution.
When an abnormality is detected, the instruction immediately before the abnormality occurs is re-executed. Therefore, even if the abnormality occurs due to the arrival of noise or the like, the processing can be immediately restarted.

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

【図1】本発明に係るマイクロコンピュータの一実施例
を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a microcomputer according to the present invention.

【図2】上記マイクロコンピュータの第2の実施例を示
すブロック図である。
FIG. 2 is a block diagram showing a second embodiment of the microcomputer.

【図3】上記マイクロコンピュータの第3の実施例を示
すブロック図である。
FIG. 3 is a block diagram showing a third embodiment of the microcomputer.

【図4】従来のマイクロコンピュータのブロック図であ
る。
FIG. 4 is a block diagram of a conventional microcomputer.

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

1 マイクロコンピュータ部 2 アドレスバス及びデータバス 3 内部レジスタ 4 補助レジスタ 5 モニタメモリ 6 演算論理部 7 補助演算論理部 8 制御バス 9 比較回路 10,12 割り込み制御回路 11 カウンタ 13 カウント値設定回路 14 カウント値モニタ回路 1 microcomputer part 2 address bus and data bus 3 internal register 4 auxiliary register 5 monitor memory 6 arithmetic logic unit 7 auxiliary arithmetic logic unit 8 control bus 9 comparison circuit 10, 12 interrupt control circuit 11 counter 13 count value setting circuit 14 count value Monitor circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 命令を実行するレジスタ及び論理演算部
に対応して設けられ前記命令を模擬実行する補助レジス
タ及び補助論理演算部と、この補助レジスタ及び補助論
理演算部による命令の模擬実行結果と前記レジスタ及び
論理演算部による命令の実行結果とを比較する比較回路
と、比較回路の比較結果に応じて割り込み信号を発生す
る割り込み制御回路と、前記割り込み信号により前記命
令の実行直前の状態へ復帰させるモニタメモリとを備え
たことを特徴とするマイクロコンピュータ。
1. An auxiliary register and an auxiliary logical operation unit, which are provided corresponding to a register for executing an instruction and a logical operation unit, and execute the instruction by simulation, and an instruction execution result of the instruction by the auxiliary register and the auxiliary logical operation unit. A comparison circuit that compares the execution result of the instruction by the register and the logical operation unit, an interrupt control circuit that generates an interrupt signal according to the comparison result of the comparison circuit, and a state immediately before the execution of the instruction by the interrupt signal A microcomputer provided with a monitor memory for controlling.
【請求項2】 命令を実行するレジスタ及び論理演算部
に対応して設けられ前記命令を模擬実行する補助レジス
タ及び補助論理演算部と、この補助レジスタ及び補助論
理演算部による命令の模擬実行結果と前記レジスタ及び
論理演算部による命令の実行結果とを比較し不一致の場
合にはエラー信号を発生する比較回路と、前記エラー信
号の出力回数をカウントすると共にこのカウント値が一
定時間の経過または一定数の命令を実行する間に所定の
値に達した時に出力信号を発生するカウンタと、このカ
ウンタの出力信号に基づいて例外処理を実行させるため
の割り込み信号を発生する割り込み制御回路とを備えた
ことを特徴とするマイクロコンピュータ。
2. An auxiliary register and an auxiliary logical operation unit, which are provided corresponding to a register for executing an instruction and a logical operation unit, and execute the instruction by simulation, and a simulated execution result of the instruction by the auxiliary register and the auxiliary logical operation unit. A comparison circuit that compares the execution results of the instructions by the register and the logical operation unit and generates an error signal when they do not match, and counts the number of times the error signal is output, and the count value passes a fixed time or a fixed number. A counter for generating an output signal when a predetermined value is reached during execution of the instruction, and an interrupt control circuit for generating an interrupt signal for executing exception processing based on the output signal of the counter. Microcomputer characterized by.
【請求項3】 請求項2記載のマイクロコンピュータに
おいて、前記例外処理へ移行する前記カウンタのカウン
ト値を任意に設定する設定回路と、前記カウント値を参
照可能なモニタ回路とを備えたことを特徴とするマイク
ロコンピュータ。
3. The microcomputer according to claim 2, further comprising a setting circuit that arbitrarily sets a count value of the counter that shifts to the exception processing, and a monitor circuit that can refer to the count value. And a microcomputer.
JP4005347A 1992-01-16 1992-01-16 Microcomputer Pending JPH05189258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4005347A JPH05189258A (en) 1992-01-16 1992-01-16 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4005347A JPH05189258A (en) 1992-01-16 1992-01-16 Microcomputer

Publications (1)

Publication Number Publication Date
JPH05189258A true JPH05189258A (en) 1993-07-30

Family

ID=11608676

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4005347A Pending JPH05189258A (en) 1992-01-16 1992-01-16 Microcomputer

Country Status (1)

Country Link
JP (1) JPH05189258A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016110502A (en) * 2014-12-09 2016-06-20 株式会社デンソー Electronic controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016110502A (en) * 2014-12-09 2016-06-20 株式会社デンソー Electronic controller

Similar Documents

Publication Publication Date Title
JP2013137835A (en) Microcomputer and method of operation thereof
JPH03175537A (en) Error controller for debugging microprocessor
JPH05189258A (en) Microcomputer
JP2002268915A (en) System and method for monitoring unaligned memory access
JPH08171504A (en) Emulation device
JP4647276B2 (en) Semiconductor circuit device
JP2659067B2 (en) Microcomputer reset circuit
JPH05233374A (en) Watchdog timer device
JP2695775B2 (en) How to recover from computer system malfunction
JPH033041A (en) Time-out monitoring circuit
JP3183982B2 (en) Digital controller
JP2000330798A (en) Interrupt controller and method for verifying interrupt control
JPH0436841A (en) Microcomputer
JP2786215B2 (en) Restart processing control method
JPS6146535A (en) Pseudo error setting control system
JPH07182251A (en) Microprocessor
JPH09190360A (en) Microcomputer and its ranaway monitoring processing method
JPH03266136A (en) Evaluation chip
JPH0535892A (en) Microcomputer
JPS58158747A (en) Programable controller
JPH05143478A (en) Device for protecting contents of non-volatile memory
JPH01293448A (en) Microcomputer
JPH05120075A (en) Runaway detecting method for cpu
JPH04225432A (en) Interruption processing time control system for one-chip microcomputer
JPH01211001A (en) Controller using microprocessor