JP2006099654A - Semiconductor circuit apparatus - Google Patents

Semiconductor circuit apparatus Download PDF

Info

Publication number
JP2006099654A
JP2006099654A JP2004287709A JP2004287709A JP2006099654A JP 2006099654 A JP2006099654 A JP 2006099654A JP 2004287709 A JP2004287709 A JP 2004287709A JP 2004287709 A JP2004287709 A JP 2004287709A JP 2006099654 A JP2006099654 A JP 2006099654A
Authority
JP
Japan
Prior art keywords
counter
reference value
signal
processor
semiconductor circuit
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.)
Granted
Application number
JP2004287709A
Other languages
Japanese (ja)
Other versions
JP4647276B2 (en
Inventor
Kimitake Tsuyuno
公丈 露野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Electronics Corp
Original Assignee
NEC Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2004287709A priority Critical patent/JP4647276B2/en
Publication of JP2006099654A publication Critical patent/JP2006099654A/en
Application granted granted Critical
Publication of JP4647276B2 publication Critical patent/JP4647276B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)
  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To detect an operation abnormality of a processor quickly. <P>SOLUTION: A microcomputer 1 monitors the operation of a CPU 11 and executes recovery processing coping with the case that the abnormality is detected. An abnormality determination part 15 makes abnormality determination by a state transitional signal outputted in response to a state transition by the CPU 11. The abnormality determination part 15 is provided with a counter 151 for counting synchronized with a counter clock and, when the state transitional signal is detected, resets the counter 151. When the abnormality determination part 15 does not detect the state transitional signal but the counter 151 has reached a reference value, the abnormality determination part 15 determines it to be abnormal in processing operation. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は半導体回路装置に関し、特に、回路動作の異常判定を実行する半導体回路装置に関する。   The present invention relates to a semiconductor circuit device, and more particularly, to a semiconductor circuit device that executes circuit operation abnormality determination.

現在、パーソナルコンピュータなどのコンピュータ・システムに限らず、家電製品やOA機器、自動車や製造装置の制御装置など、多くの電子機器においてマイクロコンピュータが利用されている。マイクロコンピュータは、機能的要素として、命令コードやアドレスを含むデータを読み出して命令実行の結果に応じてマイクロコンピュータ全体を制御す制御部、算術演算や論理演算を実行する演算処理部、必要なデータを記憶するレジスタ・セットなどを備えている。また、各種装置の制御装置として実装される場合には、ROMやRAMなどのメモリの他、各種周辺機能などを備えている。また、制御部、演算処理部、及びレジスタ・セットなどはCPU内の機能要素として実装される。マイクロコンピュータはプログラムに含まれる命令コードを順次解読し、それに従って処理を行うことで所望の機能を実現する。   At present, microcomputers are used not only in computer systems such as personal computers but also in many electronic devices such as home appliances, OA devices, automobiles, and control devices for manufacturing apparatuses. As a functional element, a microcomputer reads out data including an instruction code and an address and controls the entire microcomputer according to the result of instruction execution, an arithmetic processing part that executes arithmetic operations and logical operations, and necessary data A register set for storing data is provided. When implemented as a control device for various devices, it has various peripheral functions in addition to memories such as ROM and RAM. A control unit, an arithmetic processing unit, a register set, and the like are implemented as functional elements in the CPU. The microcomputer sequentially decodes the instruction code included in the program and performs a process according to the instruction code, thereby realizing a desired function.

命令コードはレジスタ・セットに含まれるプログラム・カウンタの示すアドレスからフェッチされる。例えば外部ノイズなどのためにプログラム・カウンタの値が変化すると、マイクロコンピュータは不測のアドレスにアクセスし、マイクロコンピュータのプログラム実行が暴走する問題が知られている。このため、マイクロコンピュータの暴走を自動的に検出し、暴走に対応した復帰処理を行うことが必要とされる。暴走検出の方法としては、これまでにいくつかのものが提案されている。例えば、ROMに記憶されているプログラムにTRAP命令を分散的に配置することによって暴走を検出し、TRAP処理によって所定の復帰プログラムを実行することができる。   The instruction code is fetched from the address indicated by the program counter included in the register set. For example, when the value of the program counter changes due to external noise or the like, there is a problem that the microcomputer accesses an unexpected address and the program execution of the microcomputer runs out of control. For this reason, it is necessary to automatically detect a microcomputer runaway and perform a recovery process corresponding to the runaway. Several methods for detecting runaway have been proposed so far. For example, a runaway can be detected by distributing TRAP instructions in a program stored in the ROM, and a predetermined return program can be executed by TRAP processing.

この他、例えば特許文献1は、マイクロコンピュータの一つの暴走検出方法について開示している。特許文献1に開示されたマイクロコンピュータは暴走検出カウンタを備え、常にそれを動作させている。暴走検出カウンタがオーバーフローとなると暴走と判定し、CPUに異常信号を出力する。マイクロコンピュータは、通常動作時の所定のタイミングで暴走検出カウンタをクリアする。これによって正常動作時に暴走検出カウンタがオーバーフローとなることがなく、正常動作と異なる暴走を検出することができる。   In addition, for example, Patent Document 1 discloses one runaway detection method for a microcomputer. The microcomputer disclosed in Patent Document 1 includes a runaway detection counter, and always operates it. When the runaway detection counter overflows, it is determined that runaway occurs and an abnormal signal is output to the CPU. The microcomputer clears the runaway detection counter at a predetermined timing during normal operation. As a result, the runaway detection counter does not overflow during normal operation, and runaway that differs from normal operation can be detected.

具体的には、マイクロコンピュータはプログラムの実行アドレスを監視し、あらかじめ登録されたアドレスを実行していれば暴走検出カウンタのクリアを行なう。また、マイクロコンピュータの周辺ハードウェアの要因がすべて正しく機能している場合に、暴走検出用カウンタのクリアを行なう。暴走検出用カウンタのクリアは、ソフトウェア(プログラム)を介さずハードウェアによって直接に行われる。このように、暴走検出用カウンタのクリアをハードウェアで行なうことによって、プログラム実行の暴走中に誤ってプログラムが暴走検出カウンタをクリアすることを防止し、プログラム実行が暴走したときの暴走検出を確実に行なうことができる。
特開2004−151846号公報
Specifically, the microcomputer monitors the execution address of the program, and clears the runaway detection counter if the pre-registered address is executed. Also, when all the peripheral hardware factors of the microcomputer are functioning correctly, the runaway detection counter is cleared. The runaway detection counter is cleared directly by hardware without using software (program). In this way, by clearing the runaway detection counter in hardware, it is possible to prevent the program from accidentally clearing the runaway detection counter during program execution runaway, and to ensure runaway detection when program execution has runaway Can be done.
JP 2004-151446 A

上記特許文献1の技術において、マイクロコンピュータの異常判定の基準となる信号は、CPUが特定アドレスのプログラムを実行した際に出力する信号であり、マイクロコンピュータ内の動作による二次的な信号であった。このように、従来の技術はCPUの動作に直接に起因する信号を監視するものではないので、マイクロコンピュータの動作異常を確実にあるいは迅速に検出することができなかった。例えば、CPUの故障によりプログラムの実行が不安定である場合でもあっても、特定アドレスが実行されカウンタのオーバーフローが起きない程度に信号が出力される場合には、CPUの異常を検出することができなかった。あるいは、バス上のメモリ等の異常により通常よりCPUによるアクセス時間が長くなる場合であっても、カウンタのオーバーフローが起きない程度に信号が出力される限り、異常を検出することができなかった。   In the technique of the above-mentioned Patent Document 1, a signal that is a criterion for microcomputer abnormality determination is a signal that is output when the CPU executes a program of a specific address, and is a secondary signal due to an operation in the microcomputer. It was. As described above, since the conventional technique does not monitor a signal directly attributable to the operation of the CPU, it has been impossible to reliably or quickly detect an abnormal operation of the microcomputer. For example, even if the execution of a program is unstable due to a CPU failure, if a signal is output to the extent that a specific address is executed and the counter does not overflow, an abnormality in the CPU can be detected. could not. Alternatively, even when the access time by the CPU is longer than usual due to an abnormality in the memory on the bus, the abnormality cannot be detected as long as the signal is output to the extent that the counter does not overflow.

本発明は上記のような事情を背景としてなされたものであって、本発明の一つの目的は、回路動作の異常検出を改善することである。   The present invention has been made against the background described above, and one object of the present invention is to improve the detection of abnormalities in circuit operation.

本発明の第1の態様は、命令コードに従って動作し、複数の異なる動作状態を遷移するプロセッサと、前記動作状態に基づいて前記プロセッサから出力される状態信号が、予め定められた条件において検出されたかを判定する判定部と、前記状態信号が予め定められた条件において検出されなかったと前記判定部が判定した場合に、予め定められた回復処理を指示する回復処理指示部とを有する。状態信号を使用することによって、回路動作の異常を迅速に検出することができる。   According to a first aspect of the present invention, a processor that operates according to an instruction code and transitions between a plurality of different operation states, and a state signal output from the processor based on the operation state is detected under a predetermined condition. And a recovery processing instruction unit that instructs a predetermined recovery process when the determination unit determines that the state signal has not been detected under a predetermined condition. By using the status signal, an abnormal circuit operation can be detected quickly.

前記状態信号は、前記プロセッサの動作状態の遷移に応答して出力される状態遷移信号であることが好ましい。あるいは、前記状態信号は、前記プロセッサの命令フェッチ状態において出力されるフェッチ信号であることが好ましい。これらの信号を使用することでプロセッサ処理における異常を迅速に検出することができる。   It is preferable that the state signal is a state transition signal output in response to a transition of the operation state of the processor. Alternatively, it is preferable that the status signal is a fetch signal output in an instruction fetch state of the processor. By using these signals, abnormalities in processor processing can be detected quickly.

前記判定部は、前記状態信号が規準時間内に検出されるかを判定し、前記回復処理指示部は、前記状態信号が前記規準時間内に検出されなかったと前記判定部が判定した場合に、前記回復処理を指示することが好ましい。これによって、プロセッサの動作停止を迅速に検出することができる。   The determination unit determines whether the state signal is detected within a reference time, and the recovery processing instruction unit, when the determination unit determines that the state signal is not detected within the reference time, It is preferable to instruct the recovery process. Thereby, it is possible to quickly detect the stop of the operation of the processor.

前記判定部は、基準値を記憶する基準値記憶部と前記状態信号に基づいて制御されるカウンタとを備え、前記基準値と前記カウンタのカウンタ値とに基づき前記状態信号の検出を判定し、前記半導体回路装置は、前記基準値記憶部に記憶されている基準値を、前記プロセッサの処理に基づいて変更する基準値設定部をさらに備えることが好ましい。これによって、プロセッサ処理に応じた適切な回路動作異常の検出を行うことができる。   The determination unit includes a reference value storage unit that stores a reference value and a counter that is controlled based on the state signal, and determines the detection of the state signal based on the reference value and the counter value of the counter, Preferably, the semiconductor circuit device further includes a reference value setting unit that changes a reference value stored in the reference value storage unit based on processing of the processor. This makes it possible to detect an appropriate circuit operation abnormality according to the processor processing.

前記判定部は、カウント・クロックに従ってカウントし前記状態信号に基づいて制御されるカウンタを備え、前記カウンタのカウント値が予め定められた基準値に達する前に前記状態信号を検出するかを判定し、前記半導体回路装置は、前記カウンタのカウントを制御信号に従って停止するカウンタ制御部をさらに備えることが好ましい。これによって、プロセッサ処理に応じた適切な回路動作異常の検出を行うことができる。前記状態信号が予め定められた条件において検出されなかったと前記判定部が判定した場合に、前記プロセッサが保持している命令実行アドレスを一時的に保持する命令実行アドレス保持部をさらに備えることが好ましい。これによって、回復処理後に中断された処理から再開することができる。   The determination unit includes a counter that counts according to a count clock and is controlled based on the state signal, and determines whether the state signal is detected before the count value of the counter reaches a predetermined reference value. The semiconductor circuit device preferably further includes a counter control unit that stops the counting of the counter according to a control signal. This makes it possible to detect an appropriate circuit operation abnormality according to the processor processing. It is preferable to further include an instruction execution address holding unit that temporarily holds an instruction execution address held by the processor when the determination unit determines that the state signal is not detected under a predetermined condition. . Thereby, it is possible to resume from the process interrupted after the recovery process.

本発明の第2の態様は半導体回路装置であって、命令コードに従って動作するプロセッサと、入力信号に従ってカウントするカウンタと、基準値を記憶する基準値記憶部と、前記カウンタのカウント値と前記基準値とに基づき回路動作異常を判定する判定部と、前記基準値記憶部に記憶されている基準値を、前記プロセッサの処理に基づいて変更する基準値設定部を有する。基準値をプロセッサの処理に基づいて変更することによって、プロセッサ処理に応じた適切な回路動作異常の検出を行うことができる。   A second aspect of the present invention is a semiconductor circuit device, a processor that operates according to an instruction code, a counter that counts according to an input signal, a reference value storage unit that stores a reference value, a count value of the counter, and the reference And a reference value setting unit that changes a reference value stored in the reference value storage unit based on processing of the processor. By changing the reference value based on the processing of the processor, it is possible to detect an appropriate circuit operation abnormality according to the processor processing.

前記カウンタは、前記入力信号としてのカウント・クロックに同期してカウントし、前記プロセッサからの信号に応答してクリアされ、前記判定部は、前記カウンタのカウント値が前記基準値に達している場合に回路動作異常と判定することが好ましい。これによりカウンタを使用した異常検出を効果的に行うことができる。前記基準値設定部は、前記プロセッサのアクセス先に基づいて前記基準値を変更することが好ましい。これによって、アクセス先によって変化するプロセッサの処理時間に応じた適切な異常検出を行うことができる。   The counter counts in synchronization with a count clock as the input signal, and is cleared in response to a signal from the processor, and the determination unit has a case where the count value of the counter reaches the reference value It is preferable to determine that the circuit operation is abnormal. Thereby, abnormality detection using a counter can be performed effectively. Preferably, the reference value setting unit changes the reference value based on an access destination of the processor. As a result, it is possible to perform an appropriate abnormality detection according to the processing time of the processor that varies depending on the access destination.

本発明の第3の態様は半導体回路装置であって、命令コードに従って処理を実行するプロセッサと、カウント・クロックに従ってカウントするカウンタと、前記カウンタのカウント値が予め定められた基準値に達した場合に、前記プロセッサ処理の異常と判定する判定部と、制御信号に従って前記カウンタのカウントを停止するカウンタ制御部を有する。これによって、より正確なプロセッサ処理の異常検出を行うことができる。   A third aspect of the present invention is a semiconductor circuit device, in which a processor that executes processing according to an instruction code, a counter that counts according to a count clock, and a count value of the counter reaches a predetermined reference value A determination unit that determines that the processor processing is abnormal, and a counter control unit that stops counting of the counter according to a control signal. As a result, it is possible to more accurately detect abnormalities in processor processing.

前記判定部は、前記基準値を記憶する基準値記憶部を備えており、前記半導体回路装置は、前記基準値記憶部の基準値を前記プロセッサの処理に基づいて変更する基準値設定部をさらに備えることが好ましい。これによって、プロセッサ処理に応じた適切な回路動作異常の検出を行うことができる。   The determination unit includes a reference value storage unit that stores the reference value, and the semiconductor circuit device further includes a reference value setting unit that changes a reference value of the reference value storage unit based on processing of the processor. It is preferable to provide. This makes it possible to detect an appropriate circuit operation abnormality according to the processor processing.

前記判定部は、前記カウント値が前記基準値に達して前記カウンタがオーバーフローした場合に、前記プロセッサの動作異常と判定することができる。前記制御信号は前記プロセッサへのウェイト信号であることが好ましい。あるいは、前記制御信号は前記プロセッサがスタンバイ状態に対応して出力されるスタンバイ信号であることが好ましい。これらの信号によってカウント動作を停止することによって、より正確な異常検出を行うことができる。   The determination unit can determine that the processor is operating abnormally when the count value reaches the reference value and the counter overflows. The control signal is preferably a wait signal to the processor. Alternatively, the control signal is preferably a standby signal output by the processor in response to a standby state. By stopping the counting operation with these signals, more accurate abnormality detection can be performed.

本発明によれば、回路動作における異常検出を改善することができる。   According to the present invention, abnormality detection in circuit operation can be improved.

以下に、本発明を適用可能な実施の形態が説明される。以下の説明は、本発明の実施形態を説明するものであり、本発明が以下の実施形態に限定されるものではない。説明の明確化のため、以下の記載及び図面は、適宜、省略及び簡略化がなされている。又、当業者であれば、以下の実施形態の各要素を、本発明の範囲において容易に変更、追加、変換することが可能である。   Hereinafter, embodiments to which the present invention can be applied will be described. The following description is to describe the embodiment of the present invention, and the present invention is not limited to the following embodiment. For clarity of explanation, the following description and drawings are omitted and simplified as appropriate. Moreover, those skilled in the art can easily change, add, and convert each element of the following embodiments within the scope of the present invention.

実施の形態1.
本実施形態のマイクロコンピュータは、プロセッサ(本形態ではCPUとして示されている)の動作をモニタし、異常を検出した場合に対応する回復処理を実行する。プロセッサ動作の異常は、プロセッサからその動作状態に基づいて出力される状態信号を検出することによって行う。本形態のおいては、状態信号として、プロセッサの動作状態の遷移に応じて出力される状態遷移信号が使用される。プロセッサからの状態信号によってその異常を判定することによって、プロセッサの動作異常を迅速に検出することができる。
Embodiment 1 FIG.
The microcomputer of this embodiment monitors the operation of a processor (shown as a CPU in this embodiment) and executes a recovery process corresponding to the case where an abnormality is detected. The abnormality of the processor operation is performed by detecting a state signal output from the processor based on the operation state. In this embodiment, a state transition signal output in response to a transition of the operating state of the processor is used as the state signal. By determining the abnormality based on the status signal from the processor, it is possible to quickly detect an abnormal operation of the processor.

プロセッサ動作の異常検出のため、本形態のマイクロコンピュータはカウンタを使用する。例えば、カウンタをプロセッサの状態信号に基づいてクリアし、カウンタが基準値に達するとプロセッサの動作異常と判定して、対応する回復処理を実行する。プロセッサの状態遷移が正常に行われている場合には、基準値に達する前にカウンタがクリアされる。状態遷移が正常ではない場合にカウンタが基準値に達し、プロセッサ動作の異常を検出することができる。基準値は、プロセッサの処理に応じて変化される。これによって、異常検出をより適切なものとすることができる。   In order to detect abnormalities in processor operation, the microcomputer of this embodiment uses a counter. For example, the counter is cleared based on the status signal of the processor, and when the counter reaches the reference value, it is determined that the operation of the processor is abnormal, and the corresponding recovery process is executed. If the processor state transition is normal, the counter is cleared before the reference value is reached. When the state transition is not normal, the counter reaches the reference value, and an abnormality in the processor operation can be detected. The reference value is changed according to the processing of the processor. Thereby, abnormality detection can be made more appropriate.

本形態のマイクロコンピュータにおける異常検出について詳しい説明を行う前に、まず、本形態のマイクロコンピュータのハードウェア構成について、その概略を説明する。図1は、本実施形態に係るマイクロコンピュータ1のハードウェア構成の概略を模式的に示すブロック図である。マイクロコンピュータ1は、プロセッサの一例であるCPU11、読み出し専用メモリであるROM12、任意のアドレスを指定してデータを読み書きすることが可能なRAM13、周辺回路との間のデータの入出力をインターフェースする周辺I/O回路14を備えている。CPU11、ROM12、RAM13及び周辺I/O回路14は内部バスを介して接続されており、各回路は、命令コード、アドレスあるいは演算データなどのデータ及び制御信号を、内部バスを介して互いに入出力する。   Before describing in detail the abnormality detection in the microcomputer of this embodiment, the outline of the hardware configuration of the microcomputer of this embodiment will be described first. FIG. 1 is a block diagram schematically showing an outline of the hardware configuration of the microcomputer 1 according to this embodiment. The microcomputer 1 includes a CPU 11 that is an example of a processor, a ROM 12 that is a read-only memory, a RAM 13 that can read and write data by specifying an arbitrary address, and a peripheral that interfaces data input and output with peripheral circuits. An I / O circuit 14 is provided. The CPU 11, ROM 12, RAM 13 and peripheral I / O circuit 14 are connected via an internal bus, and each circuit inputs and outputs data such as an instruction code, an address or calculation data and a control signal via the internal bus. To do.

さらに、マイクロコンピュータ1は、CPU11の処理動作の異常を検出する異常判定部15、異常判定部15の検出結果に基づいて回復処理の指示を行う監視部16及びCPU11動作の異常発生時における命令実行アドレスを記憶する命令実行アドレス保持部17を備えている。異常判定部15はCPU11の動作をモニタし、CPU11動作の異常を検出すると異常検出信号を監視部16に出力する。監視部16は、異常検出信号に応答して回復処理の指示を行う。回復処理の指示は、割り込み要求、あるいは、リセット信号等として出力される。   Further, the microcomputer 1 includes an abnormality determination unit 15 that detects an abnormality in the processing operation of the CPU 11, a monitoring unit 16 that instructs a recovery process based on the detection result of the abnormality determination unit 15, and instruction execution when an abnormality occurs in the CPU 11 operation. An instruction execution address holding unit 17 for storing addresses is provided. The abnormality determination unit 15 monitors the operation of the CPU 11 and outputs an abnormality detection signal to the monitoring unit 16 when an abnormality in the CPU 11 operation is detected. The monitoring unit 16 instructs recovery processing in response to the abnormality detection signal. The instruction for the recovery process is output as an interrupt request or a reset signal.

図1に示された各回路要素の構成について説明する。CPU11は、レジスタ・セット111、制御部112、演算処理部113及びバス・インターフェース114などの各回路ブロックを備えている。レジスタ・セット111は複数のレジスタからなり、命令コードやアドレスあるいは演算データなどを一時的に格納する。レジスタ・セット111には、演算データを格納するアキュムレータやプログラム実行アドレスを指示するプログラム・カウンタなどが含まれている。   The configuration of each circuit element shown in FIG. 1 will be described. The CPU 11 includes circuit blocks such as a register set 111, a control unit 112, an arithmetic processing unit 113, and a bus interface 114. The register set 111 includes a plurality of registers, and temporarily stores instruction codes, addresses, operation data, and the like. The register set 111 includes an accumulator that stores operation data, a program counter that indicates a program execution address, and the like.

制御部112は、ROM12などから命令コードをフェッチする命令フェッチ回路や、命令コードを解読する命令デコーダなどを備えている。制御部112は、ROM12やRAM13などから命令コードやアドレスを含むデータをレジスタに読み出し、命令実行の結果に応じてマイクロコンピュータ1全体を制御する。また、他の回路からの割り込み要求があった場合に、割り込み要因に応じた割り込み処理の制御を行う。割り込み処理は、ROM12に記憶されている割り込みプログラムを実行することによって行う。演算処理部113は、加減算などの数値演算、AND・OR・NOTなどの論理演算及びシフト命令などを実行する。バス・インターフェース114は、他の回路と間のデータや命令コードの入出力をインターフェースする。   The control unit 112 includes an instruction fetch circuit that fetches an instruction code from the ROM 12 or the like, an instruction decoder that decodes the instruction code, and the like. The control unit 112 reads data including an instruction code and an address from the ROM 12 and the RAM 13 into a register, and controls the entire microcomputer 1 according to the result of executing the instruction. Also, when an interrupt request is received from another circuit, the interrupt processing is controlled according to the interrupt factor. The interruption process is performed by executing an interruption program stored in the ROM 12. The arithmetic processing unit 113 executes numerical operations such as addition and subtraction, logical operations such as AND / OR / NOT, and shift instructions. The bus interface 114 interfaces data and instruction code input / output with other circuits.

ROM12は、ユーザによって設定された命令コードや演算データを予め記憶している。ROM12としては、電源が切れても記憶データを保持する不揮発性メモリが使用され、例えば、フラッシュメモリなどのEEPROM(Electrically Erasable Read-Only Memory)を使用することができる。RAM13は揮発性の記憶デバイスであり、再書き込みが不要なSRAM、一定時間毎に再書き込みが必要なDRAMなどを使用することができる。   The ROM 12 stores in advance instruction codes and calculation data set by the user. As the ROM 12, a non-volatile memory that retains stored data even when the power is turned off is used. For example, an EEPROM (Electrically Erasable Read-Only Memory) such as a flash memory can be used. The RAM 13 is a volatile storage device, and an SRAM that does not require rewriting, a DRAM that requires rewriting at regular intervals, and the like can be used.

異常判定部15は、カウンタ151及びコンペア・レジスタ152を備えている。カウンタ151は入力されたカウント・クロックに従ってカウントする。典型的には、カウント・クロックは一定周波数の信号として入力される。コンペア・レジスタ152は設定された基準値を記憶する。異常判定部15は、カウンタ151の値とコンペア・レジスタ152の値を比較する。カウンタ151の値が基準値に達した場合にCPU11動作の異常と判定し、異常検出信号を出力する。尚、異常判定部15は、コンペア・レジスタ152の値から演算により基準値を算出すること、あるいは、コンペア・レジスタ152の値とカウンタ151の値を演算処理して異常の判定を行うことも可能である。   The abnormality determination unit 15 includes a counter 151 and a compare register 152. The counter 151 counts according to the input count clock. Typically, the count clock is input as a constant frequency signal. The compare register 152 stores the set reference value. The abnormality determination unit 15 compares the value of the counter 151 with the value of the compare register 152. When the value of the counter 151 reaches the reference value, it is determined that the CPU 11 is operating abnormally, and an abnormality detection signal is output. The abnormality determination unit 15 can calculate a reference value by calculation from the value of the compare register 152, or can determine abnormality by calculating the value of the compare register 152 and the value of the counter 151. It is.

監視部16は、異常判定部15の異常判定結果に基づいて、回復処理の実行を制御する。異常判定部15が異常検出信号を出力すると、異常検出信号に応答して、監視部16は回復処理の実行を指示する。例えば、監視部16はCPU11へ割り込み要求を行う、あるいは、内部リセット信号を出力する。割り込み要求に応答して、CPU11は予め定められた割り込みプログラムをROM12から読み込み、割り込みプログラムに従って回復処理を実行する。   The monitoring unit 16 controls the execution of the recovery process based on the abnormality determination result of the abnormality determination unit 15. When the abnormality determination unit 15 outputs an abnormality detection signal, the monitoring unit 16 instructs execution of the recovery process in response to the abnormality detection signal. For example, the monitoring unit 16 issues an interrupt request to the CPU 11 or outputs an internal reset signal. In response to the interrupt request, the CPU 11 reads a predetermined interrupt program from the ROM 12 and executes recovery processing according to the interrupt program.

あるいは、回復処理の他の態様として、リセット信号によってCPU11やRAM13を選択的にリセットし、あるいは、マイクロコンピュータ1の全体をリセットすることができる。リセット後は所定の初期化処理が実行される。尚、割り込み要求を外部回路に出力し、の外部装置に対してマイクロコンピュータ1(CPU11)の異常を通知し、外部装置からリセット信号をマイクロコンピュータ1に入力することなども可能である。   Alternatively, as another aspect of the recovery process, the CPU 11 and the RAM 13 can be selectively reset by a reset signal, or the entire microcomputer 1 can be reset. After the reset, a predetermined initialization process is executed. It is also possible to output an interrupt request to an external circuit, notify the external device of an abnormality of the microcomputer 1 (CPU 11), and input a reset signal from the external device to the microcomputer 1.

命令実行アドレス保持部17は、監視部16からの制御信号に応答して、異常検出時のCPU11の命令実行アドレスを一時的に記憶する。監視部16は、異常判定部15から異常検出信号を取得すると制御信号を命令実行アドレス保持部17に出力し、その制御信号に応答してCPU11のプログラム・カウンタに記憶されている値を命令実行アドレス保持部17が記憶する。   In response to the control signal from the monitoring unit 16, the instruction execution address holding unit 17 temporarily stores the instruction execution address of the CPU 11 when an abnormality is detected. When the monitoring unit 16 obtains the abnormality detection signal from the abnormality determination unit 15, the monitoring unit 16 outputs a control signal to the instruction execution address holding unit 17, and executes the value stored in the program counter of the CPU 11 in response to the control signal. The address holding unit 17 stores it.

命令実行アドレス保持部17に記憶されたアドレスは、外部のデバッグ・ツール(不図示)で読み出しデバッグに利用する、あるいは、異常から復帰した後にCPU11によって読み出すことも可能である。異常検出時の実行アドレスを保持することによって、異常時の解析(デバッグ)をより容易なものとすることができる。あるいは、異常状態からの復帰処理において、異常発生時の実行アドレスを知ることができるので、適切な復帰処理を行うことができる。尚、実行アドレスの他に、レジスタ・セット111に記憶された他のデータを記憶することができる。   The address stored in the instruction execution address holding unit 17 can be read by an external debugging tool (not shown) and used for debugging, or can be read by the CPU 11 after recovering from an abnormality. By holding the execution address at the time of abnormality detection, analysis (debugging) at the time of abnormality can be made easier. Alternatively, in the return processing from the abnormal state, the execution address at the time of occurrence of the abnormality can be known, so that appropriate return processing can be performed. In addition to the execution address, other data stored in the register set 111 can be stored.

上記のように、カウンタ151のカウント値が基準値以上となる(基準値に達する)と、異常判定部15はCPU11の動作に異常発生したと判定する。このため、CPU11が正常に動作している場合には、カウンタ151の値をクリアする(規定値にリセットする)ことが必要である。異常判定部15は、CPU11からのクリア信号に応答してカウンタ151をクリアする。本形態において、クリア信号として状態遷移信号が使用される。図2は、カウンタ151のクリア・タイミングを示すタイミング・チャートである。図2に示すように、カウンタ151は、入力されたカウント・クロックに同期してカウンタする。本例においては、カウンタはカウント・クロックの立ち上がりタイミングでカウント・アップする。クリア信号が入力された場合、カウンタ151がクリアされる。本例では、クリア信号の立ち上がりに同期してカウンタの値が0にリセットされる。   As described above, when the count value of the counter 151 becomes equal to or greater than the reference value (reaches the reference value), the abnormality determination unit 15 determines that an abnormality has occurred in the operation of the CPU 11. For this reason, when the CPU 11 is operating normally, the value of the counter 151 needs to be cleared (reset to a specified value). The abnormality determination unit 15 clears the counter 151 in response to the clear signal from the CPU 11. In this embodiment, a state transition signal is used as the clear signal. FIG. 2 is a timing chart showing the clear timing of the counter 151. As shown in FIG. 2, the counter 151 counts in synchronization with the input count clock. In this example, the counter counts up at the rising edge of the count clock. When the clear signal is input, the counter 151 is cleared. In this example, the counter value is reset to 0 in synchronization with the rising edge of the clear signal.

上記のように、本形態のマイクロコンピュータ1は、CPU11からのクリア信号として、CPU11の動作状態遷移を表す状態遷移信号を使用する。異常判定部15はCPU11の動作状態遷移をモニタし、CPU11の動作状態遷移に基づいてカウンタ151をクリアする。これによって、状態遷移信号が所定の基準時間内に検出されない場合、CPU11処理における異常と判定される。つまり、CPU11の動作が停止し、CPU11の動作状態が次の動作状態に遷移することなく所定時間以上経過した場合に、CPU11の動作の異常と判定する。   As described above, the microcomputer 1 according to the present embodiment uses a state transition signal representing an operation state transition of the CPU 11 as a clear signal from the CPU 11. The abnormality determination unit 15 monitors the operation state transition of the CPU 11 and clears the counter 151 based on the operation state transition of the CPU 11. As a result, when the state transition signal is not detected within a predetermined reference time, it is determined that the CPU 11 process is abnormal. That is, it is determined that the operation of the CPU 11 is abnormal when the operation of the CPU 11 is stopped and the operation state of the CPU 11 has not changed to the next operation state and the predetermined time has passed.

CPU11の動作状態の変化を表す状態遷移信号が、CPU11から異常判定部15に入力される。状態遷移信号が状態遷移を示したことに応答して、異常判定部15はカウンタ151をクリアする。状態遷移信号が状態遷移を示すまでカウンタ151はカウントを進め、カウンタ151の値がコンペア・レジスタ152の基準値に達すると、異常判定部15は異常検出信号を出力する。   A state transition signal representing a change in the operating state of the CPU 11 is input from the CPU 11 to the abnormality determination unit 15. In response to the state transition signal indicating the state transition, the abnormality determination unit 15 clears the counter 151. The counter 151 advances the count until the state transition signal indicates a state transition. When the value of the counter 151 reaches the reference value of the compare register 152, the abnormality determination unit 15 outputs an abnormality detection signal.

図3は、CPU11の動作状態及び状態遷移信号の関係を示すタイミング・チャートである。本形態のCPU11はパイプライン処理によってプログラムの命令を実行する。図3に示すように、命令処理(命令サイクル)は複数の処理工程(動作状態)に分割されている。「IF(Instruction Fetch)」は命令フェッチ、「ID(Instruction Decode)」は命令デコード/レジスタ・ファイル読み出し、EX(EXecution)は実行/アドレス生成の各処理単位を示している。また、MEM(MEMory access)はメモリ・アクセス(読み出し/書き込み)、WB(Write Back)はレジスタ・ファイルへの書き込みの各処理(動作状態)を示している。   FIG. 3 is a timing chart showing the relationship between the operation state of the CPU 11 and the state transition signal. The CPU 11 of this embodiment executes program instructions by pipeline processing. As shown in FIG. 3, the instruction processing (instruction cycle) is divided into a plurality of processing steps (operation states). “IF (Instruction Fetch)” indicates an instruction fetch, “ID (Instruction Decode)” indicates an instruction decode / register file read, and EX (EXecution) indicates an execution / address generation processing unit. Further, MEM (MEMory access) indicates memory access (read / write), and WB (Write Back) indicates each process (operation state) of writing to the register file.

パイプライン処理は、異なる処理工程を同時に行うことによって、前の命令サイクルが終了する前に、次の命令サイクルを開始する。CPU11は、上記の各処理に対応する異なる回路ブロックを備え、各回路ブロックはパイプライン・レジスタを介して接続されている。各回路ブロックは、独立して処理を行う。このように、パイプライン化されたデータ・パスを備えているため、CPU11は、一つのクロックサイクルにおいて異なる処理単位を同時的に実行し、複数の命令を並列的に実行することができる。   Pipeline processing starts the next instruction cycle before the previous instruction cycle ends by performing different processing steps simultaneously. The CPU 11 includes different circuit blocks corresponding to the processes described above, and each circuit block is connected via a pipeline register. Each circuit block performs processing independently. As described above, since the pipelined data path is provided, the CPU 11 can simultaneously execute different processing units in one clock cycle and execute a plurality of instructions in parallel.

状態遷移信号は、CPU11によるパイプライン処理を構成する各動作状態の終了(もしくは開始)に同期して出力される。状態遷移を表す状態遷移信号は、CPU11がパイプライン処理を正常に実行している間は、ほぼ一定の周期で出力される。しかし、メモリのロックなどによりCPU11の処理が停止すると状態遷移信号も停止し、出力信号のレベルが変化することなく一定に維持される。この状態が所定時間以上続くと、カウンタ151の値が基準値に達して。このように、CPU11の動作状態変化を監視することによって、CPU11の動作クロックに応じた異常検出が可能となり、迅速な異常検出を行うことができる。   The state transition signal is output in synchronization with the end (or start) of each operation state constituting the pipeline processing by the CPU 11. The state transition signal indicating the state transition is output at a substantially constant cycle while the CPU 11 normally executes the pipeline processing. However, when the processing of the CPU 11 stops due to memory lock or the like, the state transition signal also stops, and the level of the output signal is kept constant without changing. If this state continues for a predetermined time or more, the value of the counter 151 reaches the reference value. As described above, by monitoring the change in the operation state of the CPU 11, it is possible to detect an abnormality according to the operation clock of the CPU 11, and it is possible to quickly detect an abnormality.

本形態のマイクロコンピュータ1は、さらに、コンペア・レジスタ152に記憶された基準値を、CPU11の処理に基づいて変化させる。例えば、メモリへのアクセス(図3におけるMEMステージ)時間は、メモリ(アクセス先)の応答時間によって変化する。アクセスされるメモリ(アクセス先)は、ROM12、RAM13の他、外部バスに接続される外部装置であり、あるいは、周辺I/O回路14のレジスタなどである。   The microcomputer 1 of the present embodiment further changes the reference value stored in the compare register 152 based on the processing of the CPU 11. For example, the memory access (MEM stage in FIG. 3) time varies depending on the response time of the memory (access destination). The memory (access destination) to be accessed is an external device connected to the external bus in addition to the ROM 12 and the RAM 13, or a register of the peripheral I / O circuit 14.

これらの応答時間はそれぞれ異なりうるため、CPU11停止の許容時間(CPU11動作が異常であると判定する時間)を、アクセス先に応じて適切な値に設定することが好ましい。本形態においては、CPU11もしくはその要求に従う異常判定部15は、CPU11のアクセス先に応じて、コンペア・レジスタ152の基準値を決定し、その値を設定する。これによって、カウンタ151の値が基準値に達するまでの時間を変更し、現在の状態に遷移してから次の状態に遷移することなく異常と判定するまでの時間を適切な時間に設定する。以上の構成を有することによって、CPU11のアクセス先に合ったCPU11停止の許容時間を設定することができ、CPU11の動作異常の検出精度を向上することができる。   Since these response times can be different from each other, it is preferable to set the allowable time for stopping the CPU 11 (the time for determining that the CPU 11 operation is abnormal) to an appropriate value according to the access destination. In this embodiment, the CPU 11 or the abnormality determination unit 15 according to the request determines the reference value of the compare register 152 according to the access destination of the CPU 11 and sets the value. As a result, the time until the value of the counter 151 reaches the reference value is changed, and the time from the transition to the current state to the determination of an abnormality without transition to the next state is set to an appropriate time. By having the above configuration, it is possible to set an allowable time for stopping the CPU 11 according to the access destination of the CPU 11, and to improve the detection accuracy of the abnormal operation of the CPU 11.

尚、本形態のマイクロコンピュータ1は、異常判定部15や監視部16などの回路を内部回路として備えているが、これらを外部回路として構成することも可能である。また、カウンタ151の値をコンペア・レジスタ152の基準値と比較するのではなく、異常判定部15は、カウンタ151がオーバーフローした場合に異常検出信号を出力することも可能である。さらに、異常判定部15は、CPU11の動作に応じてオーバーフロー値を再設定することも可能である。   The microcomputer 1 according to the present embodiment includes circuits such as the abnormality determination unit 15 and the monitoring unit 16 as internal circuits, but these can also be configured as external circuits. Further, instead of comparing the value of the counter 151 with the reference value of the compare register 152, the abnormality determination unit 15 can output an abnormality detection signal when the counter 151 overflows. Furthermore, the abnormality determination unit 15 can reset the overflow value in accordance with the operation of the CPU 11.

また、本形態のCPU11動作の異常検出は、様々なタイプのマイクロコンピュータに適用することが可能である。例えば、MPU、周辺用LSI(MPR:Micro Peripheral Unit)、マイクロコントローラ、DSP(Digital Signal Processor)など、いずれのタイプのマイクロコンピュータに適用することも可能である。これらの点は、以下の記載において同様である。   Further, the abnormality detection of the CPU 11 operation according to the present embodiment can be applied to various types of microcomputers. For example, the present invention can be applied to any type of microcomputer such as an MPU, a peripheral LSI (MPR: Micro Peripheral Unit), a microcontroller, and a DSP (Digital Signal Processor). These points are the same in the following description.

実施の形態2.
図4を参照して、本実施形態に係るマイクロコンピュータについて説明する。本形態のマイクロコンピュータは、実施の形態1と異なり、プロセッサからの状態信号として、プロセッサの各動作状態(1命令サイクルにおける処理工程)において必ず出力される信号を使用する。特に、以下においては、命令フェッチ動作状態におけるフェッチ信号に従って、プロセッサの動作異常の判定を実行する例を説明する。
Embodiment 2. FIG.
A microcomputer according to the present embodiment will be described with reference to FIG. Unlike the first embodiment, the microcomputer of this embodiment uses a signal that is always output in each operation state of the processor (processing step in one instruction cycle) as a state signal from the processor. In particular, in the following, an example will be described in which a determination of an abnormal operation of a processor is performed according to a fetch signal in an instruction fetch operation state.

また、プロセッサ動作の異常検出のため、本形態のマイクロコンピュータはカウンタを使用する。本形態のマイクロコンピュータは、実施の形態1と異なり、予め定められた状態信号の検出に応答してカウンタをカウントアップし、所定時間内に基準値に達しない場合にプロセッサの動作異常と判定して、対応する回復処理を実行する。   Further, the microcomputer of this embodiment uses a counter for detecting an abnormality in the processor operation. Unlike the first embodiment, the microcomputer of this embodiment counts up the counter in response to detection of a predetermined state signal, and determines that the processor is operating abnormally if the reference value is not reached within a predetermined time. The corresponding recovery process is executed.

図4は、本実施形態に係るマイクロコンピュータ2のハードウェア構成の概略を模式的に示すブロック図である。本形態のマイクロコンピュータ2は、異常判定部25とカウンタ251において実施の形態1と異なり、他の構成要素は実施の形態1において説明されたものと同様である。異常判定部25には、CPU11からフェッチバスに出力されるフェッチ信号が入力される。フェッチ信号として、フェッチバス上のリードクロック、フェッチアドレス、あるいはフェッチバスの使用権取得信号などを使用することができる。尚、異常判定部25はフェチバス上の信号をモニタするのではなく、命令フェッチ状態にあるCPU11から出力される信号を直接に異常判定部25に入力することも可能である。   FIG. 4 is a block diagram schematically showing the outline of the hardware configuration of the microcomputer 2 according to this embodiment. The microcomputer 2 of this embodiment is different from that of the first embodiment in the abnormality determination unit 25 and the counter 251, and other components are the same as those described in the first embodiment. The abnormality determination unit 25 receives a fetch signal output from the CPU 11 to the fetch bus. As the fetch signal, a read clock on the fetch bus, a fetch address, a fetch bus use right acquisition signal, or the like can be used. The abnormality determination unit 25 may not directly monitor the signal on the fetish bus, but may directly input a signal output from the CPU 11 in the instruction fetch state to the abnormality determination unit 25.

本例において、カウンタ251は、カウント・クロックではなく、CPU11から入力されたフェッチ信号に応答してカウントアップする。異常判定部25は、予め定められた基準時間において、カウンタ251のカウント値が予め定められた基準値に達しているかを判定する。異常判定部25は、カウント値が基準値に達している場合、CPU動作に異常がないと判定し、カウンタ251をクリアする。クリアされたカウンタ251は、検出したフェッチ信号に応答したカウント処理を始めから再開する。   In this example, the counter 251 counts up in response to the fetch signal input from the CPU 11 instead of the count clock. The abnormality determination unit 25 determines whether or not the count value of the counter 251 reaches a predetermined reference value at a predetermined reference time. When the count value reaches the reference value, the abnormality determination unit 25 determines that there is no abnormality in the CPU operation, and clears the counter 251. The cleared counter 251 restarts the counting process in response to the detected fetch signal from the beginning.

カウント値が基準値に達していない場合、異常判定部25はCPU11の動作に異常が発生したと判定する。本例においては、フェッチ信号が基準時間内に基準回数検出されなかった場合(つまり、基準時間内にフェッチ信号が検出されなかったことに相当する)、異常判定部25はCPU11に動作に異常があると判定する。これによって、命令フェッチ処理(動作状態)が基準時間内に基準回数実行されなかった場合、異常判定部25はCPU11に動作に異常があると判定する。   When the count value does not reach the reference value, the abnormality determination unit 25 determines that an abnormality has occurred in the operation of the CPU 11. In this example, when the fetch signal is not detected the reference number within the reference time (that is, when the fetch signal is not detected within the reference time), the abnormality determination unit 25 causes the CPU 11 to malfunction. Judge that there is. As a result, when the instruction fetch process (operation state) is not executed the reference number of times within the reference time, the abnormality determination unit 25 determines that the CPU 11 has an operation abnormality.

例えば、CPU11の故障やバスのロックなどによってCPU11に実行が停止した場合、実行プログラムのフェッチ信号が停止する。異常判定部25は、カウンタ251のカウンタ値が規定値に達しないことによって、CPU11の実行停止(動作異常)を検出することができる。CPU11異常判定部25が異常と判定した場合の回復処理は、実施の形態1と同様である。上記のように、CPU11の各動作状態において出力される信号をモニタして、CPU11の動作異常を判定することによって、CPU11の動作異常を迅速に検出することができる。   For example, when execution of the CPU 11 is stopped due to a failure of the CPU 11 or a bus lock, the fetch signal of the execution program stops. The abnormality determination unit 25 can detect the execution stop (operation abnormality) of the CPU 11 when the counter value of the counter 251 does not reach the specified value. The recovery process when the CPU 11 abnormality determination unit 25 determines that there is an abnormality is the same as in the first embodiment. As described above, by monitoring the signals output in each operation state of the CPU 11 and determining the operation abnormality of the CPU 11, the operation abnormality of the CPU 11 can be detected quickly.

本実施形態はフェッチ信号の例を説明したが、命令デコード/レジスタ・ファイル読み出し、実行/アドレス生成など、他の動作状態において出力される信号を状態信号として使用することが可能である。また、実施の形態1で説明したように、カウンタ・クロックに従って動作するカウンタを使用して、異常検出を行うことが可能である。反対に、実施の形態1において、状態信号検出に応答して動作するカウンタを使用することが可能である。   In this embodiment, an example of a fetch signal has been described. However, a signal output in another operation state such as instruction decode / register file read and execution / address generation can be used as a state signal. Further, as described in the first embodiment, it is possible to detect abnormality using a counter that operates in accordance with a counter clock. On the other hand, in the first embodiment, it is possible to use a counter that operates in response to detection of a state signal.

実施の形態1と同様に、コンペア・レジスタ152の値をCPU11の処理に応じて変更することも可能である。例えば、処理に時間を要する命令を実行するためにフェッチ信号が一時的に停止する場合に、コンペア・レジスタ152の値を変更することで異常検出を適切化することができる。又、フェッチ先(ROM11やRAM13)に応じて、コンペア・レジスタ152の値を変更することもできる。尚、状態遷移信号とフェッチ信号など、複数の異なる状態信号を使用してCPU11動作の異常判定を行うことも可能である。   As in the first embodiment, the value of the compare register 152 can be changed according to the processing of the CPU 11. For example, when the fetch signal is temporarily stopped to execute an instruction that requires time for processing, abnormality detection can be made appropriate by changing the value of the compare register 152. Also, the value of the compare register 152 can be changed according to the fetch destination (ROM 11 or RAM 13). It should be noted that it is possible to determine the abnormality of the CPU 11 operation using a plurality of different state signals such as a state transition signal and a fetch signal.

実施の形態3.
図5及び6を参照して、本実施形態に係るマイクロコンピュータについて説明する。本形態のマイクロコンピュータは、実施の形態1と異なり、異常判定部のカウンタに入力されるカウント・クロックをマスクするマスク制御部を備えている。マスク制御部がカウント・クロックをマスクすることによってカウンタのカウントが停止し、カウンタの制御を容易に行うことができる。
Embodiment 3 FIG.
The microcomputer according to the present embodiment will be described with reference to FIGS. Unlike the first embodiment, the microcomputer of this embodiment includes a mask control unit that masks the count clock input to the counter of the abnormality determination unit. When the mask control unit masks the count clock, the counter stops counting, and the counter can be easily controlled.

図5本実施形態に係るマイクロコンピュータの概略構成を模式的に示すブロック図である。図に示すように、マイクロコンピュータ3は、マスク制御部31を備えている。マスク制御部31にはカウント・クロックとカウント・クロックのマスクを制御する制御信号が入力される。本形態においては、好ましい態様として、ROM12、RAM13及び周辺I/O回路14からのウェイト信号が制御信号として入力されている。これらのウェイト信号は、OR論理32を介してマスク制御部31に入力されている。   5 is a block diagram schematically showing a schematic configuration of the microcomputer according to the present embodiment. As shown in the figure, the microcomputer 3 includes a mask control unit 31. The mask control unit 31 receives a control signal for controlling the count clock and the mask of the count clock. In this embodiment, as a preferred embodiment, wait signals from the ROM 12, RAM 13 and peripheral I / O circuit 14 are input as control signals. These wait signals are input to the mask control unit 31 via the OR logic 32.

また、異常判定部35は、カウンタ351のオーバーフローに応答して異条検出信号を出力する。この他の構成は、実施の形態1と同様であり、詳細な説明を省略する。尚、実施の形態1と同様に、異常判定部35はコンペア・レジスタ152を備え、基準値とカウンタ351の値を比較することによってCPU11動作の異常を判定することも可能である。   In addition, the abnormality determination unit 35 outputs an abnormal detection signal in response to the overflow of the counter 351. Other configurations are the same as those of the first embodiment, and detailed description thereof is omitted. As in the first embodiment, the abnormality determination unit 35 includes a compare register 152 and can determine an abnormality in the operation of the CPU 11 by comparing the reference value with the value of the counter 351.

図6は、本実施形態におけるカウンタ351の制御信号とカウンタ動作の関係を示すタイミング・チャートである。図6は、CPU11からのクリア信号、マスク制御部31に入力されるカウント・クロック、マスク制御部31からのマスク信号及びカウンタ351のカウンタ動作を示している。マスク制御部31は、AND論理を備えており、ウェイト信号とカウント・クロックが入力される。ウェイト信号が入力されている場合、マスク制御部31はカウント・クロックをマスクし、マスク信号をアクティブにセットする。カウント・クロックはカウンタ351に入力されないため、カウンタ351はカウントを停止する。ROM12、RAM13及び周辺I/O回路14からのウェイト信号はOR論理32に入力されているので、これら回路要素のいずれか一つがウェイト信号を出力している場合、マスク制御部31にウェイト信号が入力される。   FIG. 6 is a timing chart showing the relationship between the control signal of the counter 351 and the counter operation in this embodiment. FIG. 6 shows a clear signal from the CPU 11, a count clock input to the mask control unit 31, a mask signal from the mask control unit 31, and a counter operation of the counter 351. The mask control unit 31 has AND logic, and receives a wait signal and a count clock. When the wait signal is input, the mask control unit 31 masks the count clock and sets the mask signal to active. Since the count clock is not input to the counter 351, the counter 351 stops counting. Since the wait signals from the ROM 12, the RAM 13 and the peripheral I / O circuit 14 are input to the OR logic 32, when any one of these circuit elements outputs the wait signal, the wait signal is sent to the mask control unit 31. Entered.

一方、ウェイト信号が入力されていない場合、マスク制御部31は入力されたカウント・クロックをカウンタ351に出力する。カウンタ351はカウント・クロックに同期してカウント処理を行う。カウンタ351がオーバーフローすると、異常判定部35が異常検出信号を監視部16に出力する。   On the other hand, when no wait signal is input, the mask control unit 31 outputs the input count clock to the counter 351. The counter 351 performs a count process in synchronization with the count clock. When the counter 351 overflows, the abnormality determination unit 35 outputs an abnormality detection signal to the monitoring unit 16.

CPU11がメモリにアクセスする場合、メモリ(RAM13)からデータがCPU11に入力されるまで、CPU11の状態遷移動作が停止する。メモリ・アクセスが不特定時間のウェイトによって変動する場合において、ウェイト時間がシステム上問題にならない場合、そのウェイト信号でカウント・クロックをマスクする。これによって、ウェイト時間以外の処理時間をカウンタ351がカウントし、監視することができる。これによって、従来不特定のウェイト時間の影に埋もれていたウェイト時間以外の処理を効果的に監視することができる。   When the CPU 11 accesses the memory, the state transition operation of the CPU 11 is stopped until data is input from the memory (RAM 13) to the CPU 11. In the case where the memory access fluctuates due to the unspecified time wait, if the wait time does not cause a problem in the system, the count clock is masked with the wait signal. Accordingly, the counter 351 can count and monitor processing time other than the wait time. As a result, it is possible to effectively monitor processing other than the wait time that has been buried in the shadow of the unspecified wait time.

例えば、CPU11がメモリ・アクセスをする場合、CPU11はバス使用権を獲得する。CPU11がメモリ(RAM13)へデータ要求を出力すると、それに応答してRAM13からCPU11のデータが入力される。RAM13が、CPU11からの要求に応答して即座にデータを出力することができない場合、RAM13はCPU11にウェイト信号を出力する。ウェイト信号が出力されている間はカウンタ151がカウントを停止することによって、ウェイト時間の影に隠れていたバス使用権の獲得時間を監視することができる。あるいは、カウント・クロックをマスクすることでカウンタのカウントを停止し監視機能を無効にすることができる。デバッグ時など、監視機能を停止させたい場合に有効である。   For example, when the CPU 11 performs memory access, the CPU 11 acquires the right to use the bus. When the CPU 11 outputs a data request to the memory (RAM 13), the data of the CPU 11 is input from the RAM 13 in response. If the RAM 13 cannot output data immediately in response to a request from the CPU 11, the RAM 13 outputs a wait signal to the CPU 11. While the wait signal is output, the counter 151 stops counting, so that the bus use right acquisition time hidden behind the wait time can be monitored. Alternatively, the counter function can be stopped by masking the count clock to disable the monitoring function. This is useful when you want to stop the monitoring function when debugging.

上記例においては、ウェイト信号を使用してカウント・クロックをマスクするが、この他、マイクロコンピュータのスタンバイ状態に対応するスタンバイ信号を使用することができる。スタンバイ信号は、マイクロコンピュータ3をスタンバイ状態にセットするためにマイクロコンピュータ入力される、あるいは、スタンバイ状態になった後にマイクロコンピュータ内で出力される信号である。又、外部端子から制御信号に応じてカウント・クロックをマスクすることができる。図5に示されたOR論理32にスタンバイ信号や外部端子からの制御信号を入力する。これによって、これらの信号に応答してカウント・クロックをマスクし、監視機能を一時的に停止することができる。   In the above example, the wait signal is used to mask the count clock, but in addition to this, a standby signal corresponding to the standby state of the microcomputer can be used. The standby signal is a signal that is input to the microcomputer in order to set the microcomputer 3 in the standby state, or that is output in the microcomputer after the standby state is set. In addition, the count clock can be masked according to the control signal from the external terminal. A standby signal and a control signal from an external terminal are input to the OR logic 32 shown in FIG. As a result, the count clock can be masked in response to these signals, and the monitoring function can be temporarily stopped.

あるいは、カウンタ351に、カウント動作を制御するカウント許可信号の入力を設けることによって、カウンタ351のカウント動作を所望のタイミングで停止させることができる。カウント許可信号は、カウント・クロックのマスク機能に代えて、あるいはマスク機能と共に利用することができる。尚、本例においては複数の回路要素からのウェイト信号をOR論理に入力して利用しているが、一つの回路からのウェイト信号のみを使用する、あるいは複数の回路要素からの信号をAND論理に入力することも可能である。   Alternatively, the count operation of the counter 351 can be stopped at a desired timing by providing the counter 351 with an input of a count permission signal for controlling the count operation. The count permission signal can be used in place of the mask function of the count clock or together with the mask function. In this example, the wait signals from a plurality of circuit elements are input to the OR logic and used, but only the wait signals from one circuit are used, or the signals from the plurality of circuit elements are AND logic. Can also be entered.

第1の実施形態に係るマイクロコンピュータのハードウェア構成を模式的に示すブロック図である。It is a block diagram showing typically the hardware constitutions of the microcomputer concerning a 1st embodiment. 第1の実施形態に係るカウンタのクリア・タイミングを示すタイミング・チャートである。It is a timing chart which shows the clear timing of the counter concerning a 1st embodiment. 第1の実施形態に係るCPUの動作状態及び状態遷移信号の関係を示すタイミング・チャートである。It is a timing chart which shows the relationship between the operation state of CPU which concerns on 1st Embodiment, and a state transition signal. 第2の実施形態に係るマイクロコンピュータのハードウェア構成を模式的に示すブロック図である。It is a block diagram which shows typically the hardware constitutions of the microcomputer which concerns on 2nd Embodiment. 第3の実施形態に係るマイクロコンピュータのハードウェア構成を模式的に示すブロック図である。It is a block diagram which shows typically the hardware constitutions of the microcomputer which concerns on 3rd Embodiment. 第3の実施形態に係るカウンタのカウント動作、クリア信号及びマスク信号の関係を示すタイミング・チャートである。10 is a timing chart showing a relationship between a count operation of a counter according to a third embodiment, a clear signal, and a mask signal.

符号の説明Explanation of symbols

1 マイクロコンピュータ、2 マイクロコンピュータ、
3 マイクロコンピュータ、14 周辺I/O回路、15 カウンタ、
15 異常判定部、16 監視部、17 命令実行アドレス保持部、
25 異常判定部、31 マスク制御部、32 OR論理、35 異常判定部、
111 レジスタ・セット、112 制御部、113 演算処理部、
114 バス・インターフェース、151 カウンタ、
152 コンペア・レジスタ、251 カウンタ、351 カウンタ
1 microcomputer, 2 microcomputer,
3 microcomputer, 14 peripheral I / O circuit, 15 counter,
15 abnormality determination unit, 16 monitoring unit, 17 instruction execution address holding unit,
25 abnormality determination unit, 31 mask control unit, 32 OR logic, 35 abnormality determination unit,
111 register set, 112 control unit, 113 arithmetic processing unit,
114 bus interface, 151 counter,
152 Compare register, 251 counter, 351 counter

Claims (15)

命令コードに従って動作し、複数の異なる動作状態を遷移するプロセッサと、
前記動作状態に基づいて前記プロセッサから出力される状態信号が、予め定められた条件において検出されたかを判定する判定部と、
前記状態信号が予め定められた条件において検出されなかったと前記判定部が判定した場合に、予め定められた回復処理を指示する回復処理指示部と、
を有する、半導体回路装置。
A processor that operates according to the instruction code and transitions between different operating states;
A determination unit that determines whether a state signal output from the processor based on the operation state is detected under a predetermined condition;
A recovery process instruction unit that instructs a predetermined recovery process when the determination unit determines that the state signal has not been detected under a predetermined condition;
A semiconductor circuit device.
前記状態信号は、前記プロセッサの動作状態の遷移に応答して出力される状態遷移信号である、請求項1に記載の半導体回路装置。   The semiconductor circuit device according to claim 1, wherein the state signal is a state transition signal output in response to a transition of an operation state of the processor. 前記状態信号は、前記プロセッサの命令フェッチ状態において出力されるフェッチ信号である、請求項1に記載の半導体回路装置。   The semiconductor circuit device according to claim 1, wherein the state signal is a fetch signal output in an instruction fetch state of the processor. 前記判定部は、前記状態信号が規準時間内に検出されるかを判定し、
前記回復処理指示部は、前記状態信号が前記規準時間内に検出されなかったと前記判定部が判定した場合に、前記回復処理を指示する、
請求項1に記載の半導体回路装置。
The determination unit determines whether the state signal is detected within a reference time,
The recovery process instruction unit instructs the recovery process when the determination unit determines that the status signal is not detected within the reference time.
The semiconductor circuit device according to claim 1.
前記判定部は、基準値を記憶する基準値記憶部と前記状態信号に基づいて制御されるカウンタとを備え、前記基準値と前記カウンタのカウンタ値とに基づき前記状態信号の検出を判定し、
前記半導体回路装置は、前記基準値記憶部に記憶されている基準値を、前記プロセッサの処理に基づいて変更する基準値設定部をさらに備える、
請求項1に記載の半導体回路装置。
The determination unit includes a reference value storage unit that stores a reference value and a counter that is controlled based on the state signal, and determines the detection of the state signal based on the reference value and the counter value of the counter,
The semiconductor circuit device further includes a reference value setting unit that changes a reference value stored in the reference value storage unit based on processing of the processor.
The semiconductor circuit device according to claim 1.
前記判定部は、カウント・クロックに従ってカウントし前記状態信号に基づいて制御されるカウンタを備え、前記カウンタのカウント値が予め定められた基準値に達する前に前記状態信号を検出するかを判定し、
前記半導体回路装置は、前記カウンタのカウントを制御信号に従って停止するカウンタ制御部をさらに備える、
請求項1又は5に記載の半導体回路装置。
The determination unit includes a counter that counts according to a count clock and is controlled based on the state signal, and determines whether the state signal is detected before the count value of the counter reaches a predetermined reference value. ,
The semiconductor circuit device further includes a counter control unit that stops counting of the counter according to a control signal.
6. The semiconductor circuit device according to claim 1 or 5.
前記状態信号が予め定められた条件において検出されなかったと前記判定部が判定した場合に、前記プロセッサが保持している命令実行アドレスを一時的に保持する命令実行アドレス保持部をさらに備える、請求項1に記載の半導体回路装置。   The apparatus further comprises an instruction execution address holding unit that temporarily holds an instruction execution address held by the processor when the determination unit determines that the state signal is not detected under a predetermined condition. 2. The semiconductor circuit device according to 1. 命令コードに従って動作するプロセッサと、
入力信号に従ってカウントするカウンタと、
基準値を記憶する基準値記憶部と、
前記カウンタのカウント値と前記基準値とに基づき回路動作異常を判定する判定部と、
前記基準値記憶部に記憶されている基準値を、前記プロセッサの処理に基づいて変更する基準値設定部と、
を有する半導体回路装置。
A processor that operates according to the instruction code;
A counter that counts according to the input signal;
A reference value storage unit for storing a reference value;
A determination unit for determining a circuit operation abnormality based on the count value of the counter and the reference value;
A reference value setting unit that changes the reference value stored in the reference value storage unit based on the processing of the processor;
A semiconductor circuit device.
前記カウンタは、前記入力信号としてのカウント・クロックに同期してカウントし、前記プロセッサからの信号に応答してクリアされ、
前記判定部は、前記カウンタのカウント値が前記基準値に達している場合に回路動作異常と判定する、
請求項8に記載の半導体回路装置。
The counter counts in synchronization with a count clock as the input signal, and is cleared in response to a signal from the processor,
The determination unit determines that the circuit operation is abnormal when the count value of the counter has reached the reference value;
The semiconductor circuit device according to claim 8.
前記基準値設定部は、前記プロセッサのアクセス先に基づいて前記基準値を変更する、請求項8に記載の半導体回路装置。   The semiconductor circuit device according to claim 8, wherein the reference value setting unit changes the reference value based on an access destination of the processor. 命令コードに従って処理を実行するプロセッサと、
カウント・クロックに従ってカウントするカウンタと、
前記カウンタのカウント値が予め定められた基準値に達した場合に、前記プロセッサ処理の異常と判定する判定部と、
制御信号に従って前記カウンタのカウントを停止するカウンタ制御部と、
を有する半導体回路装置。
A processor that executes processing according to an instruction code;
A counter that counts according to the count clock;
A determination unit that determines that the processor process is abnormal when the count value of the counter reaches a predetermined reference value;
A counter control unit for stopping the counting of the counter according to a control signal;
A semiconductor circuit device.
前記判定部は、前記基準値を記憶する基準値記憶部を備えており、
前記半導体回路装置は、前記基準値記憶部の基準値を前記プロセッサの処理に基づいて変更する基準値設定部をさらに備える、
請求項11に記載の半導体回路装置。
The determination unit includes a reference value storage unit that stores the reference value,
The semiconductor circuit device further includes a reference value setting unit that changes a reference value of the reference value storage unit based on processing of the processor,
The semiconductor circuit device according to claim 11.
前記判定部は、前記カウント値が前記基準値に達して前記カウンタがオーバーフローした場合に、前記プロセッサの動作異常と判定する、請求項11に記載の半導体回路装置。   The semiconductor circuit device according to claim 11, wherein the determination unit determines that the processor is operating abnormally when the count value reaches the reference value and the counter overflows. 前記制御信号は前記プロセッサへのウェイト信号である、請求項11に記載の半導体回路装置。   The semiconductor circuit device according to claim 11, wherein the control signal is a wait signal to the processor. 前記制御信号は前記プロセッサがスタンバイ状態に対応して出力されるスタンバイ信号である、請求項11に記載の半導体回路装置。   12. The semiconductor circuit device according to claim 11, wherein the control signal is a standby signal output in response to a standby state of the processor.
JP2004287709A 2004-09-30 2004-09-30 Semiconductor circuit device Expired - Fee Related JP4647276B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004287709A JP4647276B2 (en) 2004-09-30 2004-09-30 Semiconductor circuit device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004287709A JP4647276B2 (en) 2004-09-30 2004-09-30 Semiconductor circuit device

Publications (2)

Publication Number Publication Date
JP2006099654A true JP2006099654A (en) 2006-04-13
JP4647276B2 JP4647276B2 (en) 2011-03-09

Family

ID=36239365

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004287709A Expired - Fee Related JP4647276B2 (en) 2004-09-30 2004-09-30 Semiconductor circuit device

Country Status (1)

Country Link
JP (1) JP4647276B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152544A (en) * 2006-12-18 2008-07-03 Hitachi Ltd Verification device of control microcomputer and onboard control device
JP2010134677A (en) * 2008-12-04 2010-06-17 Renesas Electronics Corp Microcomputer and embedded software development system
JP2012208739A (en) * 2011-03-30 2012-10-25 Nec Saitama Ltd Terminal device, and freeze detection method and control method therefor

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS619735A (en) * 1984-06-25 1986-01-17 Ricoh Co Ltd Resetting system of cpu
JPS63237147A (en) * 1987-03-25 1988-10-03 Nec Corp Supervisory system for input/output actions in computer system
JPH0283751A (en) * 1988-09-21 1990-03-23 Hitachi Ltd Information processor
JPH04181469A (en) * 1990-11-16 1992-06-29 Fujitsu Ltd History recording system for vector processing device
JPH05257750A (en) * 1992-03-13 1993-10-08 Fujitsu Ltd Watchdog timer control circuit
JPH05342063A (en) * 1992-06-11 1993-12-24 Kofu Nippon Denki Kk Tracer circuit
JPH0756774A (en) * 1993-08-16 1995-03-03 Oki Electric Ind Co Ltd Watching timer
JPH07168741A (en) * 1993-12-15 1995-07-04 Toshiba Corp Watchdog timer device
JPH08339308A (en) * 1995-06-12 1996-12-24 Hitachi Ltd Digital processor
JPH11203171A (en) * 1998-01-08 1999-07-30 Nissan Motor Co Ltd Watch dog timer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS619735A (en) * 1984-06-25 1986-01-17 Ricoh Co Ltd Resetting system of cpu
JPS63237147A (en) * 1987-03-25 1988-10-03 Nec Corp Supervisory system for input/output actions in computer system
JPH0283751A (en) * 1988-09-21 1990-03-23 Hitachi Ltd Information processor
JPH04181469A (en) * 1990-11-16 1992-06-29 Fujitsu Ltd History recording system for vector processing device
JPH05257750A (en) * 1992-03-13 1993-10-08 Fujitsu Ltd Watchdog timer control circuit
JPH05342063A (en) * 1992-06-11 1993-12-24 Kofu Nippon Denki Kk Tracer circuit
JPH0756774A (en) * 1993-08-16 1995-03-03 Oki Electric Ind Co Ltd Watching timer
JPH07168741A (en) * 1993-12-15 1995-07-04 Toshiba Corp Watchdog timer device
JPH08339308A (en) * 1995-06-12 1996-12-24 Hitachi Ltd Digital processor
JPH11203171A (en) * 1998-01-08 1999-07-30 Nissan Motor Co Ltd Watch dog timer

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008152544A (en) * 2006-12-18 2008-07-03 Hitachi Ltd Verification device of control microcomputer and onboard control device
JP4496205B2 (en) * 2006-12-18 2010-07-07 日立オートモティブシステムズ株式会社 Control microcomputer verification device and in-vehicle control device
JP2010134677A (en) * 2008-12-04 2010-06-17 Renesas Electronics Corp Microcomputer and embedded software development system
JP2012208739A (en) * 2011-03-30 2012-10-25 Nec Saitama Ltd Terminal device, and freeze detection method and control method therefor

Also Published As

Publication number Publication date
JP4647276B2 (en) 2011-03-09

Similar Documents

Publication Publication Date Title
JP4393954B2 (en) Microcomputer
US7558990B2 (en) Semiconductor circuit device and method of detecting runaway
US6158023A (en) Debug apparatus
JP2007323631A (en) Cpu runaway determination circuit
JP2008033890A (en) Microcomputer system
JP4647276B2 (en) Semiconductor circuit device
US6463492B1 (en) Technique to automatically notify an operating system level application of a system management event
JP2006344087A (en) Task management device for controller and task management method for controller
US20050060690A1 (en) Microprocessor system with software emulation processed by auxiliary hardware
JPH06324914A (en) Runaway detecting method for computer
US6567930B1 (en) Method and apparatus for controlling writing of flash EEPROM by microcomputer
US11656964B2 (en) Processor with non-intrusive self-testing
JP2006221606A (en) Data processor
JP4571462B2 (en) Microcomputer
JP2004302847A (en) Method for monitoring operation of cpu
JP2008262557A (en) Task management device for controller and task management method for controller
JP2677609B2 (en) Microcomputer
JP5012562B2 (en) Microcomputer
JP2009093393A (en) Data processing device, and self-diagnosis method for data processing device
JP2009289119A (en) Watchdog timer and microcomputer
JP2005293077A (en) Debug system and method for equipment having power saving function of cpu
KR20040003870A (en) Circuit for clocking change of MCU and method for the same
JP5331451B2 (en) Microcontroller
JP2716274B2 (en) In-circuit emulator
JP2013148999A (en) Controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070814

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091009

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091027

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100525

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100722

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101207

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101208

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

Free format text: PAYMENT UNTIL: 20131217

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees