JP6130735B2 - Microcontroller and error detection method - Google Patents
Microcontroller and error detection method Download PDFInfo
- Publication number
- JP6130735B2 JP6130735B2 JP2013112789A JP2013112789A JP6130735B2 JP 6130735 B2 JP6130735 B2 JP 6130735B2 JP 2013112789 A JP2013112789 A JP 2013112789A JP 2013112789 A JP2013112789 A JP 2013112789A JP 6130735 B2 JP6130735 B2 JP 6130735B2
- Authority
- JP
- Japan
- Prior art keywords
- value
- storage unit
- set value
- unit
- duplicate
- 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.)
- Expired - Fee Related
Links
- 238000001514 detection method Methods 0.000 title claims description 25
- 238000012795 verification Methods 0.000 claims description 47
- 230000002093 peripheral effect Effects 0.000 claims description 24
- 238000012937 correction Methods 0.000 claims description 8
- 230000010076 replication Effects 0.000 claims description 7
- 238000000034 method Methods 0.000 description 41
- 238000012545 processing Methods 0.000 description 19
- 238000010586 diagram Methods 0.000 description 7
- 230000000052 comparative effect Effects 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
Images
Description
本発明は、マイクロコントローラ及び誤り検出方法に関する。 The present invention relates to a microcontroller and an error detection method.
マイクロコントローラ(マイクロコンピュータと呼ばれる場合もある)は、各種周辺回路(タイマ、通信回路など)などの設定値が格納された記憶素子を有している。このような設定値のなかには、マイクロコントローラによる機器(自動車、家電製品、携帯電話など)の制御に直接影響するデータが含まれる場合があるが、記憶素子が中性子線などの影響を受け、そのデータが変わってしまい、信頼性が劣化する可能性がある。 A microcontroller (sometimes called a microcomputer) has a storage element in which set values such as various peripheral circuits (a timer, a communication circuit, etc.) are stored. Some of these set values may include data that directly affects the control of devices (automobiles, home appliances, mobile phones, etc.) by a microcontroller. May change and reliability may deteriorate.
RAM(Random Access Memory)の高信頼化技術としては、ECC(Error Correcting Code)などのパリティをRAMに付加して、データの読み出し時に誤りを検出し訂正する手法がある。また、RAMを多重化したり、RAM内に複数の領域を形成し、同一データを複数のRAMまたは同一RAM内の複数の領域に記憶しておき、読み出しの際に値を比較するミラーリング手法がある。 As a technique for improving the reliability of RAM (Random Access Memory), there is a technique of adding a parity such as ECC (Error Correcting Code) to the RAM and detecting and correcting an error when reading data. There is also a mirroring method in which RAMs are multiplexed, a plurality of areas are formed in the RAM, the same data is stored in a plurality of RAMs or a plurality of areas in the same RAM, and values are compared at the time of reading. .
しかし、周辺回路の設定値については、プロセッサ側から読み出される命令コードなどとは異なり、一旦書き込まれた後は、通常プロセッサ側からのリードは発生せず、誤り検出及び訂正の機会がない。そのため、単にECC付のRAMを用いた手法では、設定値の信頼性を確保することは難しい。そこで、プロセッサによって、記憶素子に保存された設定値に対する定期的な更新が行われる。また、ミラーリング手法についても、より信頼性を確保したい設定値についてはプロセッサによる設定値の定期的な更新が行われることが考えられる。 However, unlike the instruction code read from the processor side, the set values of the peripheral circuits are not read from the normal processor side after being written once, and there is no opportunity for error detection and correction. For this reason, it is difficult to ensure the reliability of the set value with a method that simply uses a RAM with ECC. Therefore, the processor periodically updates the set value stored in the storage element. In addition, with respect to the mirroring method, it is conceivable that the setting values for which the reliability is to be ensured are periodically updated by the processor.
このようにプロセッサによる設定値の定期的な更新が行われる場合、プロセッサで行っている処理が、設定値の更新処理のために中断することになり、処理速度の低下など、機器の制御に悪影響を与える懸念がある。 When the set value is regularly updated by the processor in this way, the processing performed by the processor is interrupted due to the set value update process, which adversely affects device control, such as a reduction in processing speed. There is concern to give.
発明の一観点によれば、周辺回路の設定値を保持する第1の記憶部と、前記設定値の複製値を保持し、読み出し時に前記複製値のエラー検出及び訂正を行う第2の記憶部と、複数の前記設定値の前記第1の記憶部への書き込み時期に基づき、前記書き込み時期が古い前記設定値を優先的に前記第1の記憶部から読み出し、読み出した前記設定値に対応する前記複製値を前記第2の記憶部から読み出し、比較検証を行う比較検証部と、を備えたマイクロコントローラが提供される。 According to one aspect of the invention, a first storage unit that holds a setting value of a peripheral circuit, and a second storage unit that holds a replication value of the setting value and detects and corrects the error of the replication value at the time of reading. And, based on the writing times of the plurality of setting values to the first storage unit, the setting values with the old writing time are preferentially read from the first storage unit and correspond to the read setting values. There is provided a microcontroller including a comparison verification unit that reads the duplicate value from the second storage unit and performs comparison verification.
また、発明の一観点によれば、周辺回路の設定値を第1の記憶部に書き込み、前記設定値の複製値を、読み出し時に前記複製値のエラー検出及び訂正を行う第2の記憶部に書き込み、比較検証部が、複数の前記設定値の前記第1の記憶部への書き込み時期に基づき、前記書き込み時期が古い前記設定値を優先的に前記第1の記憶部から読み出し、読み出した前記設定値に対応する前記複製値を前記第2の記憶部から読み出し、比較検証を行う、誤り検出方法が提供される。 According to another aspect of the invention, the setting value of the peripheral circuit is written in the first storage unit, and the duplicate value of the setting value is stored in the second storage unit that performs error detection and correction of the duplicate value at the time of reading. The writing / comparison / verification unit preferentially reads out and reads out the setting value with an earlier writing time from the first storage unit based on the writing time of the plurality of setting values into the first storage unit. An error detection method is provided in which the duplicate value corresponding to a set value is read from the second storage unit and compared and verified.
開示のマイクロコントローラ及び誤り検出方法によれば、プロセッサの処理を中断せずに周辺回路の設定値の誤りを容易に検出できる。 According to the disclosed microcontroller and error detection method, it is possible to easily detect an error in setting values of peripheral circuits without interrupting the processing of the processor.
以下、発明を実施するための形態を、図面を参照しつつ説明する。
(第1の実施の形態)
図1は、第1の実施の形態のマイクロコントローラの一例を示す図である。
Hereinafter, embodiments for carrying out the invention will be described with reference to the drawings.
(First embodiment)
FIG. 1 is a diagram illustrating an example of a microcontroller according to the first embodiment.
第1の実施の形態のマイクロコントローラ1は、プロセッサ2、周辺回路3a,3b,3c、記憶部4,5、比較検証部6を有する。
プロセッサ2は、マイクロコントローラ1の各部を制御する。プロセッサ2は、たとえば、CPU(Central Processing Unit)、MPU(Micro Processing Unit)、DSP(Digital Signal Processor)、ASIC(Application Specific Integrated Circuit)、またはPLD(Programmable Logic Device)である。またプロセッサ2は、CPU、MPU、DSP、ASIC、PLDのうちの2以上の要素の組み合わせであってもよい。
The microcontroller 1 of the first embodiment includes a
The
周辺回路3a,3b,3cは、マイクロコントローラ1が制御する外部機器に対する接続用のインタフェース、タイマなどである。なお、周辺回路3a〜3cは、マイクロコントローラ1の外部に設けられていてもよい。
The
記憶部4は、たとえば、レジスタ(フリップフロップなど)4a,4b,4cを有する。記憶部4は、周辺回路3a,3b,3cを制御するための設定値a,b,cを保持している。
The
記憶部5は、設定値a〜cの複製値aa,bb,ccを保持する。また、記憶部5には、設定値の書き込み時期(更新時期)に関する情報(履歴情報)も格納される。書き込み時期は、たとえば、図示しないカウンタの値として格納される。記憶部5は、エラー検出、訂正用のパリティを含み、読み出し時に複製値のエラー検出及び訂正を行う。記憶部5は、たとえば、ECC付RAMである。なお、履歴情報は、別の記憶部に記憶されるようにしてもよい。
The
比較検証部6は、上記履歴情報を参照して、複数の設定値a〜cの記憶部4への書き込み時期に基づき、書き込み時期が古い設定値を優先的に記憶部4から読み出し、それに対応する複製値を記憶部5から読み出し、それらの比較検証を行う。比較検証部6は、たとえば、図1のように優先順位判定部6aと比較部6bを有している。
The comparison verification unit 6 refers to the history information, reads the setting values with the oldest writing time from the
優先順位判定部6aは、履歴情報に基づき、たとえば、設定値a〜cのうち、どの設定値が最も書き込み時期が古いかを判定し、最も書き込み時期が古い設定値の優先順位を一番高くする。比較部6bは、優先順位の高い設定値から順に、所定の間隔で、対応する複製値との比較を行う。記憶部4から読み出された設定値a〜cが、記憶部5から読み出された複製値aa〜ccと異なる場合には、比較部6bは、たとえば、その旨をプロセッサ2に通知する。
Based on the history information, for example, the priority
以下、第1の実施の形態のマイクロコントローラ1による誤り検出方法の一例を、フローチャートを用いて説明する。
図2は、誤り検出方法の一例を示すフローチャートである。
Hereinafter, an example of an error detection method performed by the microcontroller 1 according to the first embodiment will be described with reference to a flowchart.
FIG. 2 is a flowchart illustrating an example of an error detection method.
たとえば、ユーザによる設定値aの書き込み要求があると、プロセッサ2の制御のもと、設定値aが記憶部4のレジスタ4aに書き込まれるとともに、その複製値aaが記憶部5に書き込まれる(ステップS1)。また、書き込み時期も記憶部5に記憶される(ステップS2)。その他の設定値b,cについても書き込み要求があった場合には、同様にプロセッサ2の制御のもと、設定値b,cが記憶部4のレジスタ4b,4cに書き込まれるとともに、その複製値bb,ccが記憶部5に書き込まれる。また、その書き込み時期が記憶部5に記憶される。
For example, when the user requests to write the set value a, the set value a is written into the
その後、ステップS3の処理が行われる。ステップS3の処理では、優先順位判定部6aは、複数の設定値a〜cの書き込み時期に基づき、優先順位を決定する。優先順位判定部6aは、書き込み時期が古い設定値の優先順位を高くする。たとえば、設定値a〜cの順で書き込みが行われた場合には、設定値aの優先順位が最も高く、その次に、設定値bの優先順位が高く、設定値cの最も優先順位が低くなる。
Thereafter, the process of step S3 is performed. In the process of step S3, the priority
その後、ステップS4の処理が行われる。ステップS4の処理では、まず比較部6bは、たとえば、所定期間経過した後、優先順位の最も高い設定値、すなわち、書き込み時期が最も古い設定値を記憶部4から読み出し、それに対応する複製値を記憶部5から読み出し、それらの比較検証を行う。
Thereafter, the process of step S4 is performed. In the process of step S4, the
たとえば、設定値aの優先順位が最も高い場合、設定値aと、設定値aに対応する複製値aaとの比較検証が行われる。複製値aaは、記憶部5から読み出される際にエラー検出及び訂正が行われるため、書き込み時の正しい値である可能性が高い。一方、記憶部4から読み出される設定値aは、たとえば、記憶部4が中性子線などの影響を受け、ソフトエラーが発生し、書き込み時の値とは変わっている可能性がある。そのため、設定値aを複製値aaと比較することで、設定値aの誤りを検出することが可能となる。
For example, when the priority order of the set value a is the highest, comparison verification is performed between the set value a and the duplicate value aa corresponding to the set value a. The duplicate value aa is likely to be a correct value at the time of writing because error detection and correction are performed when it is read from the
その後、ステップS5の更新処理が行われる。
設定値aが、複製値aaと異なっている場合には、比較部6bはその旨をプロセッサ2に通知し、プロセッサ2は、設定値aを更新する。そして、履歴情報や優先順位も更新される。設定値aを更新した場合には、設定値aが最も新しいものとなるため、優先順位は最も低くなる。また、比較検証部6は、設定値aと複製値aaが同じである場合(誤りがない場合)は、比較した時間の情報を履歴情報に保存し、比較した時間が新しいものの優先順位を下げるようにしてもよい。
Thereafter, the update process of step S5 is performed.
If the set value a is different from the duplicate value aa, the
なお、ステップS5の更新処理は、比較検証部6が、記憶部5から読み出した複製値で、対応する設定値を更新するようにしてもよい。
優先順位の最も高い設定値に対して、上記のような比較検証及び更新処理が行われると、比較部6bは、所定期間経過後に、次に優先順位の高い設定値に対して、上記と同様の比較検証を行う。
In the update process in step S5, the comparison / verification unit 6 may update the corresponding setting value with the duplicate value read from the
When the comparison verification and update processing as described above is performed on the setting value with the highest priority, the
以上のように、本実施の形態のマイクロコントローラ1及び誤り検出方法によれば、比較検証部6が、書き込み時期が古い、誤りが発生している可能性の高い設定値に対して、優先的に誤り検出を行う。これにより、プロセッサ2の処理を中断せずに、設定値の誤りを容易に検出できる。
As described above, according to the microcontroller 1 and the error detection method of the present embodiment, the comparison / verification unit 6 preferentially sets a setting value that has an old writing time and is likely to have an error. Error detection. Thereby, an error in the set value can be easily detected without interrupting the processing of the
そして、誤りがあった場合に、たとえば、プロセッサ2による設定値の更新処理が行われる。これにより、プロセッサ2の処理を設定値の更新のために定期的に中断しなくても、設定値の信頼性を容易に確保できるようになる。
If there is an error, for example, the
また、誤りがあった場合、比較検証部6が、記憶部5から読み出した複製値で、対応する設定値を更新するようにしてもよい。これにより、プロセッサ2の処理を、設定値の更新処理のときも中断しなくてよくなる。
If there is an error, the comparison verification unit 6 may update the corresponding setting value with the duplicate value read from the
なお、上記の説明では、3つの周辺回路3a〜3cに対して、それぞれ1つの設定値a〜cがある場合について説明したが、各周辺回路3a〜3cに対して、それぞれ複数の設定値があってもよい。また、周辺回路の数が3つに限定されず、2つまたは4つ以上あってもよい。
In the above description, the case where there is one set value a to c for each of the three
(第2の実施の形態)
図3は、第2の実施の形態のマイクロコントローラの一例を示す図である。
マイクロコントローラ10は、CPU11、バスブリッジ12、周辺回路13−1,13−2,…,13−n、レジスタ14−1,14−2,…,14−n、ECC付RAM15、比較検証部16、クロック生成部17、バスB1,B2,B3,B4を有している。
(Second Embodiment)
FIG. 3 is a diagram illustrating an example of the microcontroller according to the second embodiment.
The microcontroller 10 includes a
CPU11は、バスB1に接続されており、マイクロコントローラ10の各部を制御する。バスブリッジ12は、バスB1〜B3を相互に接続する。
周辺回路13−1〜13−nは、マイクロコントローラ10が制御する外部機器に対する接続用のインタフェース、タイマなどである。なお、周辺回路13−1〜13−nは、マイクロコントローラ1の外部に設けられていてもよい。
The
The peripheral circuits 13-1 to 13-n are an interface for connection to an external device controlled by the microcontroller 10, a timer, and the like. Note that the peripheral circuits 13-1 to 13-n may be provided outside the microcontroller 1.
レジスタ14−1〜14−nには、周辺回路13−1〜13−nを制御するための設定値が書き込まれる。レジスタ14−1〜14−nは、バスB2,B4間に接続されている。 In the registers 14-1 to 14-n, setting values for controlling the peripheral circuits 13-1 to 13-n are written. The registers 14-1 to 14-n are connected between the buses B2 and B4.
ECC付RAM15は、エラー検出及び1ビットのエラー訂正が可能なRAMであり、レジスタ14−1〜14−nに書き込まれる設定値の複製値を保持する。ECC付RAM15は、レジスタ14−1〜14−nと同じアドレス領域を持っている。また、ECC付RAM15は、設定値の更新履歴や比較検証を行った履歴に関する履歴情報を格納する。ECC付RAM15は、バスB3と比較検証部16に接続されている。
The ECC-added
比較検証部16は、履歴情報を参照して、複数の設定値の書き込み時期や比較検証を行った時間に基づき、設定値とそれに対応する複製値を、レジスタ14−1〜14−n、ECC付RAM15から読み出し、それらの比較検証を行う。比較検証部16は、バスB4とECC付RAM15とクロック生成部17に接続されている。
The
クロック生成部17は、比較検証部16内の後述するカウンタを動作させるためのクロックを生成する。このクロックは、CPU11などで用いられるクロックよりも低速のものでよい。
The
図4は、比較検証部の一例を示す図である。
比較検証部16は、カウンタ20、優先順位判定部21、RAMアクセス部22、レジスタアクセス部23、比較部24を有している。
FIG. 4 is a diagram illustrating an example of the comparison verification unit.
The
カウンタ20は、クロック生成部17から供給されるクロックをカウントする。カウンタ20は、たとえば、ECC付RAM15にレジスタ14−1〜14−nの初期値が書き込まれたことを検出すると、クロックのカウントを開始する。
The counter 20 counts clocks supplied from the
優先順位判定部21は、履歴情報を参照して、各設定値において、最後に書き込みを行ったとき、または複製値との比較検証を行ったときのカウンタ値と、現在のカウンタ値との差を求め、比較検証を行う設定値の優先順位を判定する。その差が大きい設定値ほど、優先順位判定部21は、優先順位を高くする。そして、優先順位判定部21は、最も優先順位の高い設定値における上記の差が所定の値以上になったら、レジスタアクセス部23及びRAMアクセス部22に、最も優先順位の高い設定値及びその複製値の読み出しを指示する。
The
RAMアクセス部22は、優先順位判定部21で読み出しを指示された複製値のアドレスをECC付RAM15に供給し、ECC付RAM15から読み出された複製値を、比較部24に送る。
The
レジスタアクセス部23は、優先順位判定部21で読み出しを指示された設定値のアドレスをレジスタ14−1〜14−nの何れかに供給し、レジスタ14−1〜14−nの何れかから読み出された設定値を、比較部24に送る。
The
比較部24は、読み出された複製値と設定値とを比較し、一致しているか否かを判定する。複製値と設定値とが一致している場合、比較部24は、比較時のカウンタ値で、ECC付RAM15に格納されている履歴情報を更新する。複製値と設定値とが一致していない場合、比較部24は、割り込みなどでその旨をCPU11に通知する。また、比較部24は、不一致が生じた設定値が格納されているアドレスをCPU11に通知する。なお、複製値と設定値とが一致したときも、比較部24は、その比較結果をCPU11に通知するようにしてもよい。
The
次に、マイクロコントローラ10による誤り検出方法の一例の流れを説明する。
図5は、マイクロコントローラの動作開始時の処理の一例を示すフローチャートである。
Next, an exemplary flow of an error detection method performed by the microcontroller 10 will be described.
FIG. 5 is a flowchart showing an example of processing at the start of operation of the microcontroller.
ステップS10の処理では、CPU11の制御のもと、レジスタ14−1〜14−nに書き込まれている初期値が、ECC付RAM15に転送され、書き込まれる。ステップS11の処理では、カウンタ20は、クロック生成部17から供給されるクロックのカウントを開始する。
In the process of step S10, under the control of the
ステップS12の処理では、優先順位判定部21は、CPU11からレジスタ14−1〜14−nの何れかへの設定値の書き込みが発生したか否かを判定する。書き込みが発生していない場合には、書き込みが発生するまで、ステップS12の処理が繰り返される。書き込みが発生した場合には、ステップS13の処理が行われる。
In the process of step S12, the
ステップS13の処理では、CPU11によって、ECC付RAM15において、設定値が格納されたレジスタと同じアドレスに、設定値の複製値が格納される。また、優先順位判定部21によって、書き込みが行われたときのカウンタ値が、履歴情報としてECC付RAM15に格納される。その後、ステップS12からの処理が繰り返される。
In the process of step S13, the
たとえば、マイクロコントローラ10の電源がオフとなると、上記の処理が終了する。
図6は、ECC付RAMに格納されるデータの一例を示す図である。
ECC付RAM15には、CPU11から見たレジスタ14−1〜14−nのアドレスが割り当てられている。そして、各アドレスに対して、レジスタ14−1〜14−nの番号(No.1,No.2,…,No.n)、レジスタ14−1〜14−nに格納される設定値の複製値(設定値の初期値)が格納されている。さらに、複製値の書き込み時に生成されるエラーコードであるECC(ECC No.1,ECC No.2,…,ECC No.n)と、レジスタ14−1〜14−nにおいて、最後に書き込みが行われたときのカウンタ値(C1〜Cn)が格納されている。
For example, when the power source of the microcontroller 10 is turned off, the above process ends.
FIG. 6 is a diagram illustrating an example of data stored in the ECC-added RAM.
The addresses of the registers 14-1 to 14-n viewed from the
図7は、設定値と複製値との比較検証時の処理の一例を示すフローチャートである。
ステップS20の処理では、優先順位判定部21は、レジスタアクセス部23を介して、レジスタ14−1〜14−nにアクセスして、周辺回路13−1〜13−nを有効または無効にするか指示する有効ビットが、有効を示すものであるか否かを判定する。
FIG. 7 is a flowchart illustrating an example of processing at the time of comparison verification between the set value and the duplicate value.
In the process of step S20, the
たとえば、全ての周辺回路13−1〜13−nの有効ビットが無効を示す場合には、周辺回路13−1〜13−nの有効ビットのうち、何れかが有効を示す値になるまで、ステップS20の処理が繰り返される。 For example, when the valid bits of all the peripheral circuits 13-1 to 13-n indicate invalidity, until one of the valid bits of the peripheral circuits 13-1 to 13-n becomes valid, The process of step S20 is repeated.
周辺回路13−1〜13−nの有効ビットのうち、少なくとも1つが有効を示す値である場合には、ステップS21の処理が行われる。ステップS21の処理では、優先順位判定部21は、履歴情報(図6に示したようなカウンタ値)を参照する。そして、優先順位判定部21は、各設定値において、最後に書き込みを行ったとき、または最後に複製値との比較検証を行ったときのカウンタ値と、現在のカウンタ値との差を求め、比較検証を行う設定値の優先順位を判定する。
If at least one of the valid bits of the peripheral circuits 13-1 to 13-n is a value indicating validity, the process of step S21 is performed. In the process of step S21, the priority
たとえば、図6に示したような履歴情報(カウンタ値)において、C1<C2<…<Cnであるとすると、優先順位は、レジスタ14−1の設定値、レジスタ14−2の設定値、…、レジスタ14−nの設定値の順に優先順位が低くなる。優先順位判定部21は、たとえば、記憶部を有しており、判定した優先順位を保持する。
For example, in the history information (counter value) as shown in FIG. 6, if C1 <C2 <... <Cn, the priority order is the set value of the register 14-1, the set value of the register 14-2,. , The order of priority decreases in the order of the set values in the register 14-n. The priority
図8は、優先順位の格納例を示す図である。
優先順位判定部21の記憶部21aは、たとえば、FIFO(First In First Out)で、判定した優先順位を、レジスタ番号No.1〜No.nで格納している。図8の例では、レジスタ番号No.1のレジスタ14−1の設定値が最も優先順位が高く、レジスタ番号No.2のレジスタ14−2の設定値、…、レジスタ番号No.nのレジスタ14−nの設定値の順に優先順位が低くなる。また、優先順位判定部の記憶部21aは、最も優先順位の高い設定値の履歴情報(カウンタ値)を保持するようにしてもよい。たとえば、レジスタ14−1の設定値が最も優先順位が高い場合、図6に示したカウンタ値C1が、記憶部21aに保持される。
FIG. 8 is a diagram illustrating an example of storing the priority order.
The
優先順位決定後、ステップS22の処理が行われる。ステップS22の処理では、最も優先順位の高い設定値の上記カウンタ値と現在のカウンタ値との差が、所定の値以上のとき、優先順位判定部21は、レジスタアクセス部23及びRAMアクセス部22に、設定値及びその複製値の読み出しを指示する。所定の値とは、たとえば、クロック生成部17で生成されるクロックの周期と、誤り検出を行う周期(時間)をもとに設定される。カウンタ20がクロックの立ち上がりエッジに同期してカウントアップする場合、誤り検出を行う周期をTd、クロックの周期をTcとすると、たとえば、Td/Tcが上記の所定値となる。
After the priority order is determined, the process of step S22 is performed. In the process of step S22, when the difference between the counter value of the setting value with the highest priority and the current counter value is greater than or equal to a predetermined value, the
次に、ステップS23の処理が行われる。ステップS23の処理では、比較部24は、読み出された設定値とその複製値のうち、比較不要なビットをマスクする。たとえば、周辺回路13−1〜13−nによる動作で書き変わるようなビットについては、比較しても誤りを検出できないためマスクされる(比較対象とされない)。
Next, the process of step S23 is performed. In the process of step S23, the
その後、ステップS24の処理が行われる。ステップS24の処理では、比較部24は、読み出された複製値と設定値(マスクされていない部分)とを比較し、一致しているか否かを判定する。
Thereafter, the process of step S24 is performed. In the process of step S24, the
複製値と設定値とが一致している場合、ステップS25の処理が行われる。ステップS25の処理では、比較部24は、比較時のカウンタ値で、ECC付RAM15に格納されている履歴情報を更新する。
If the duplicate value matches the set value, the process of step S25 is performed. In the processing of step S25, the
図9は、履歴情報の更新例を示す図である。
最も優先順位が高いレジスタ14−1の設定値に対して、複製値との比較が行われたときのカウンタ値がCxであった場合、ECC付RAMに格納されるデータのうち、履歴情報を示すカウンタ値が、図9に示すように更新される。また、ステップS25の処理後には、ステップS21の処理に戻り、図8に示した優先順位判定部21の記憶部21aに格納されている優先順位が更新される。
FIG. 9 is a diagram illustrating an update example of history information.
If the counter value at the time when the set value of the register 14-1 having the highest priority is compared with the duplicate value is Cx, the history information is stored in the data stored in the ECC-added RAM. The counter value shown is updated as shown in FIG. Moreover, after the process of step S25, it returns to the process of step S21, and the priority stored in the memory |
図10は、優先順位の更新例を示す図である。
図8の例では、レジスタ番号No.1のレジスタ14−1の設定値が最も優先順位が高かったが、比較検証の結果、複製値と一致している(誤りがない)と判定されたため、図10の例では、最も優先順位が低くなっている。代わりに、図8の例で、2番目に優先順位が高かったレジスタ番号No.2のレジスタ14−2の設定値が、図10の例では最も優先順位が高くなっている。また、優先順位の更新に伴い、記憶部21aは、最も優先順位が高い、レジスタ14−2の設定値に関する履歴情報(図6の例ではカウンタ値C2)を保持するようにしてもよい。
FIG. 10 is a diagram illustrating an example of updating the priority order.
In the example of FIG. The set value of the register 14-1 of No. 1 has the highest priority. However, as a result of comparison and verification, it is determined that the value matches the duplicate value (no error). Therefore, in the example of FIG. It is low. Instead, in the example of FIG. The setting value of the register 14-2 of No. 2 has the highest priority in the example of FIG. In addition, with the update of the priority order, the
一方、複製値と設定値とが一致していない場合、ステップS26の処理が行われる。ステップS26の処理では、不一致情報が、比較検証部16内の記憶部(たとえば、前述した記憶部21a)に保存される。不一致情報には、設定値と複製値との不一致が発生したレジスタのアドレス、設定値の値、設定値の更新履歴、比較履歴、現在のカウンタ値、上記履歴を示すカウンタ値と現在のカウンタ値との差分、などが含まれる。
On the other hand, if the duplicate value does not match the set value, the process of step S26 is performed. In the process of step S26, the mismatch information is stored in a storage unit (for example, the
設定値の更新履歴は、たとえば、最後にその設定値の書き込み(更新)が行われたときのカウンタ値であり、比較履歴は、たとえば、前回比較検証を行ったときのカウンタ値である。 The setting value update history is, for example, the counter value when the setting value is written (updated) last time, and the comparison history is, for example, the counter value when the previous comparison verification is performed.
その後、ステップS27の処理にて、比較部24は、割り込みなどで、CPU11に対して、不一致が生じた旨や上記の不一致情報を通知する。これにより、たとえば、CPU11は、複製値と一致しなかった設定値の更新を行うようにしてもよい。たとえば、レジスタ14−1に格納されている設定値と、その設定値の、ECC付RAM15に格納されている複製値とが一致しなかった場合、CPU11は、設定値と複製値とを更新する。
Thereafter, in the process of step S27, the
なお、設定値の更新は、比較検証部16が、ECC付RAMから読み出された複製値を、その複製値に対応する設定値が格納されたレジスタに上書きするようにしてもよい。
ステップS27の後は、ステップS21の処理に戻り、たとえば、図10に示したように、記憶部21aに格納される優先順位が更新される。
Note that the setting value may be updated by the comparison /
After step S27, the process returns to step S21, and for example, as shown in FIG. 10, the priority order stored in the
たとえば、マイクロコントローラ10の電源がオフとなると、上記の処理が終了する。
以上のように、本実施の形態のマイクロコントローラ10及び誤り検出方法によれば、比較検証部16が、書き込み時期または比較検証した時期が古い、誤りが発生している可能性の高い設定値に対して、優先的に誤り検出が行われる。これにより、CPU11の処理を中断せずに、設定値の誤りを容易に検出できる。
For example, when the power source of the microcontroller 10 is turned off, the above process ends.
As described above, according to the microcontroller 10 and the error detection method of the present embodiment, the
そして、誤りがあった場合に、たとえば、CPU11による設定値の更新処理が行われる。これにより、CPU11の処理を設定値の更新のために定期的に中断しなくても、設定値の信頼性を容易に確保できるようになる。
If there is an error, for example, the
また、誤りがあった場合、比較検証部16が、ECC付RAM15から読み出した複製値で、対応する設定値を更新するようにしてもよい。これにより、CPU11の処理を、設定値の更新処理のときも中断しなくてよくなる。
If there is an error, the
また、ある設定値に誤りがあった場合、比較検証部16が、CPU11に対して、更新履歴や比較履歴を含む不一致情報を通知することで、現在の(誤り検出時の)カウンタ値との比較から、どのカウンタ値の範囲のときに誤りが発生したか推測できる。すなわち、誤り発生時期を推測することができる。
When there is an error in a certain setting value, the
以上、実施の形態に基づき、本発明のマイクロコントローラ及び誤り検出方法の一観点について説明してきたが、これらは一例にすぎず、上記の記載に限定されるものではない。 As described above, one aspect of the microcontroller and the error detection method of the present invention has been described based on the embodiment, but these are only examples and are not limited to the above description.
1 マイクロコントローラ
2 プロセッサ
3a,3b,3c 周辺回路
4,5 記憶部
4a,4b,4c レジスタ
6 比較検証部
6a 優先順位判定部
6b 比較部
DESCRIPTION OF SYMBOLS 1
Claims (5)
前記設定値の複製値を保持し、読み出し時に前記複製値のエラー検出及び訂正を行う第2の記憶部と、
複数の前記設定値の前記第1の記憶部への書き込み時期に基づき、前記書き込み時期が古い前記設定値を優先的に前記第1の記憶部から読み出し、読み出した前記設定値に対応する前記複製値を前記第2の記憶部から読み出し、比較検証を行う比較検証部と、
を有することを特徴とするマイクロコントローラ。 A first storage unit for holding set values of peripheral circuits;
A second storage unit that holds a duplicate value of the set value and performs error detection and correction of the duplicate value at the time of reading;
Based on the writing times of the plurality of setting values to the first storage unit, the setting values with the old writing time are preferentially read from the first storage unit, and the duplication corresponding to the read setting values A comparison verification unit that reads a value from the second storage unit and performs comparison verification;
A microcontroller comprising:
前記設定値と前記設定値に対応する前記複製値とが異なっている場合、前記比較検証部は、前記プロセッサに前記比較検証の結果を通知し、
前記プロセッサは、対応する前記複製値と異なっている前記設定値の更新を行うことを特徴とする請求項1に記載のマイクロコントローラ。 Have a processor,
When the set value and the duplicate value corresponding to the set value are different, the comparison verification unit notifies the result of the comparison verification to the processor,
The microcontroller according to claim 1, wherein the processor updates the setting value different from the corresponding replication value.
前記設定値の複製値を、読み出し時に前記複製値のエラー検出及び訂正を行う第2の記憶部に書き込み、
比較検証部が、複数の前記設定値の前記第1の記憶部への書き込み時期に基づき、前記書き込み時期が古い前記設定値を優先的に前記第1の記憶部から読み出し、読み出した前記設定値に対応する前記複製値を前記第2の記憶部から読み出し、比較検証を行う、
ことを特徴とする誤り検出方法。 Write the set value of the peripheral circuit to the first storage unit,
Writing the duplicate value of the set value to a second storage unit that performs error detection and correction of the duplicate value at the time of reading,
The comparison verification unit preferentially reads out the setting value with the old writing time from the first storage unit based on the writing time of the plurality of setting values to the first storage unit, and reads out the setting value. Reading the duplicate value corresponding to the second storage unit, and performing comparison verification,
An error detection method characterized by the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013112789A JP6130735B2 (en) | 2013-05-29 | 2013-05-29 | Microcontroller and error detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013112789A JP6130735B2 (en) | 2013-05-29 | 2013-05-29 | Microcontroller and error detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014232420A JP2014232420A (en) | 2014-12-11 |
JP6130735B2 true JP6130735B2 (en) | 2017-05-17 |
Family
ID=52125765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013112789A Expired - Fee Related JP6130735B2 (en) | 2013-05-29 | 2013-05-29 | Microcontroller and error detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6130735B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7447755B2 (en) | 2020-09-30 | 2024-03-12 | 株式会社明電舎 | Memory error detection/correction system, memory error detection/correction method |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03250347A (en) * | 1990-02-28 | 1991-11-08 | Sony Corp | Memory device |
JP4174665B2 (en) * | 2003-03-31 | 2008-11-05 | 日本電気株式会社 | Information processing apparatus and memory check method |
JP2007148779A (en) * | 2005-11-28 | 2007-06-14 | Renesas Technology Corp | Microcontroller and ram |
JP2008015618A (en) * | 2006-07-03 | 2008-01-24 | Nikon Corp | Storage device and electronic equipment |
JP4998681B2 (en) * | 2006-07-10 | 2012-08-15 | 富士ゼロックス株式会社 | Information processing apparatus, operation method of information processing apparatus, and program |
-
2013
- 2013-05-29 JP JP2013112789A patent/JP6130735B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014232420A (en) | 2014-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8589763B2 (en) | Cache memory system | |
WO2016062084A1 (en) | Power-off processing method and apparatus, and electronic device | |
JP4834721B2 (en) | Memory control device and memory control method | |
JP2008015965A (en) | Information processor, operation method of information processor, and program | |
JP2005242797A (en) | Error correction circuit | |
WO2012172645A1 (en) | Memory control device and control method | |
JP6658417B2 (en) | Electronic control unit | |
JP6130735B2 (en) | Microcontroller and error detection method | |
JP4793741B2 (en) | Error correction circuit and error correction method | |
JP4941954B2 (en) | Data error detection device and data error detection method | |
JP2010181990A (en) | Data processor | |
JP2017199052A (en) | Register abnormality detection device | |
JP2014123409A (en) | Device and method for restoring information in main storage device | |
JP2014016925A (en) | Information processing system, data switching method and program | |
JP5843804B2 (en) | Arithmetic apparatus and error processing method | |
JP2019513264A (en) | Implementing Space-Efficient Storage of Dynamic Random Access Memory (DRAM) Cache Tags | |
WO2013132806A1 (en) | Nonvolatile logic integrated circuit and nonvolatile register error bit correction method | |
JP2009238359A (en) | Error-correcting function checking circuit, error-correcting function checking method, computer program therefor, and storage device | |
US9542266B2 (en) | Semiconductor integrated circuit and method of processing in semiconductor integrated circuit | |
JP3638729B2 (en) | Data storage control method and apparatus | |
JP5570252B2 (en) | Error check device, error check method, and error check program | |
JP4842036B2 (en) | Semiconductor device and abnormality detection method of timing control circuit | |
JP2013143733A (en) | Programmable apparatus | |
WO2002001363A1 (en) | Memory control device, and memory control method | |
JP2010140132A (en) | Memory system and memory controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20160118 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160408 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170308 |
|
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: 20170321 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170414 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6130735 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |