JP2013084218A - Core monitoring device and information processor - Google Patents

Core monitoring device and information processor Download PDF

Info

Publication number
JP2013084218A
JP2013084218A JP2011225171A JP2011225171A JP2013084218A JP 2013084218 A JP2013084218 A JP 2013084218A JP 2011225171 A JP2011225171 A JP 2011225171A JP 2011225171 A JP2011225171 A JP 2011225171A JP 2013084218 A JP2013084218 A JP 2013084218A
Authority
JP
Japan
Prior art keywords
core
difference
value
cores
counter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2011225171A
Other languages
Japanese (ja)
Inventor
Hideyuki Iwakiri
英之 岩切
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.)
Toyota Motor Corp
Original Assignee
Toyota Motor 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 Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2011225171A priority Critical patent/JP2013084218A/en
Publication of JP2013084218A publication Critical patent/JP2013084218A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a core monitoring device capable of determining a core causing an abnormality while suppressing an increase in software load in a multi-core icon.SOLUTION: A core monitoring device 17 accepts notifications from a plurality of cores at a common cycle and comprises: core identification numeric value generation means 31 that generates a core-specific core identification numeric value (for example, a counter value×ID) for each core when receiving notifications from the cores; total value calculation means 32 that calculates a total value of the core identification numeric values of the plurality of cores; total value storage means 36 that stores the last calculated total value; first difference calculation means 33 that calculates a first difference which is the difference between the total value calculated by the total value calculation means and the total value stored by the total value storage means; first difference storage means 37 that stores the first difference; and second difference calculation means 34 that calculates a second difference which is the difference between the first difference calculated by the first difference calculation means and the first difference stored by the first difference storage means.

Description

本発明は、複数のコアの動作状態を監視するコア監視装置に関する。   The present invention relates to a core monitoring apparatus that monitors operating states of a plurality of cores.

燃費向上や運転者の負担軽減、安全性の向上などをもたらすため、車両にはマイコンを応用した多くの電子制御装置が搭載されている。マイコンが故障するとこれらの制御が損なわれるため、マイコンの動作状態を監視してマイコンの動作を保証する対策が講じられている。このような対策としては、例えば、タスクが正常に実行されていることを定期的なタイマリセットで確認するウォッチドッグタイマが知られている。   In order to improve fuel efficiency, reduce driver's burden, and improve safety, vehicles are equipped with many electronic control devices that apply microcomputers. Since these controls are lost when a microcomputer breaks down, measures are taken to ensure the operation of the microcomputer by monitoring the operation state of the microcomputer. As such a countermeasure, for example, a watchdog timer that confirms that a task is normally executed by a periodic timer reset is known.

ところで、マイコンに、コアが複数個含まれるマルチコア型のプロセッサが搭載されるようになってきた(以下、マルチコアマイコンという)。マルチコアマイコンにおいて各コアの動作状態を監視する手法として、各コア毎にウォッチドッグタイマを用意することが考えられる。しかし、各コア用のウォッチドッグタイマを配置するとウォッチドッグタイマの数や配線が増大しコストアップとなってしまう。   By the way, a multi-core type processor including a plurality of cores has been mounted on a microcomputer (hereinafter referred to as a multi-core microcomputer). As a technique for monitoring the operating state of each core in a multi-core microcomputer, it is conceivable to prepare a watchdog timer for each core. However, if a watchdog timer for each core is arranged, the number and wiring of watchdog timers increase, resulting in an increase in cost.

そこで、複数のコアを1つのウォッチドッグタイマにより監視する技術が提案されている(例えば、特許文献1参照。)。特許文献1には、各々のコアがRAM内に確保された各コア毎の更新領域を、一定周期毎に各々の更新履歴が判るように更新し、少なくとも一つのコアがRAMの更新履歴を判定し、監視部への出力処理を行う電子制御装置が開示されている。この電子制御装置では、複数のコアの1つでもRAMを正常に更新しないと、更新領域に基づきコアが特定されるので、1つのウォッチドッグタイマで異常のあるコアのみをリセットすることができる。   Therefore, a technique for monitoring a plurality of cores with a single watchdog timer has been proposed (see, for example, Patent Document 1). In Patent Document 1, the update area of each core secured in each RAM by each core is updated so that each update history can be determined at regular intervals, and at least one core determines the RAM update history. An electronic control device that performs output processing to a monitoring unit is disclosed. In this electronic control device, if even one of the plurality of cores does not update the RAM normally, the core is specified based on the update area, so that only one core with an abnormality can be reset with one watchdog timer.

また、ウォッチドッグタイマ以外にも、コア同士で互いに監視する技術も提案されている(例えば、特許文献2参照。)。特許文献2には、被監視CPUに対して監視部が例題を出題し、例題に対する回答に基づいてCPUの演算機能を監視する監視方法が開示されている。   In addition to the watchdog timer, a technique for monitoring each other between cores has also been proposed (see, for example, Patent Document 2). Patent Document 2 discloses a monitoring method in which a monitoring unit gives an example to a monitored CPU and monitors the arithmetic function of the CPU based on an answer to the example.

特開2010−033475号公報JP 2010-033475 A 特開2010−128627号公報JP 2010-128627 A

しかしながら、特許文献1に開示された電子制御装置では、RAMの更新領域の監視と異常のあるコアの特定をソフト的に行う必要があるため、ソフト的な負荷が増大するという問題がある。すなわち、従来から、ウォッチドッグタイマをリセットする処理はソフト的に行われているが、ウォッチドッグタイマを1つにするとソフト的な負荷が余分に生じてしまう。   However, the electronic control device disclosed in Patent Document 1 has a problem that the software load increases because it is necessary to monitor the update area of the RAM and identify an abnormal core in software. That is, conventionally, the process of resetting the watchdog timer has been performed in a software manner. However, if one watchdog timer is used, an extra software load is generated.

また、特許文献2のように、あるコアが他のコアを監視する場合、被監視コア間ではどのコアに異常が生じたかを検知できないという問題がある。例えば、3つのコアを含むマルチコアにおいて、コア1とコア2が互いに監視し、コア1とコア3が互いに監視している場合を想定する。コア1がコア2の異常を検出した場合、コア3がコア2の異常を検知するためにはコア1がコア3にコア2の異常を通知しなければならない。このため、コア同士が異常のあるコアを検知するためにソフト的な負荷が発生してしまう。   Further, as in Patent Document 2, when a certain core monitors other cores, there is a problem that it is impossible to detect which core has an abnormality between monitored cores. For example, in a multi-core including three cores, it is assumed that the core 1 and the core 2 monitor each other, and the core 1 and the core 3 monitor each other. When the core 1 detects the abnormality of the core 2, the core 1 must notify the core 3 of the abnormality of the core 2 in order for the core 3 to detect the abnormality of the core 2. For this reason, a soft load is generated in order for cores to detect an abnormal core.

本発明は上記課題に鑑み、マルチコアマイコンにおいて、異常の生じたコアをソフト的な負荷増大を抑制して判別可能なコア監視装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a core monitoring apparatus capable of discriminating an abnormal core while suppressing a software load increase in a multi-core microcomputer.

本発明は、複数のコアから共通の周期で通知を受け付けるコア監視装置であって、コアから通知を受け付けた際、各コアに固有のコア識別数値をコア毎に生成するコア識別数値生成手段と、複数のコアの前記コア識別数値を合計した合計値を算出する合計値算出手段と、最後に算出された合計値を記憶する合計値記憶手段と、前記合計値算出手段が算出した合計値と、前記合計値記憶手段に記憶された合計値との差である第一の差を算出する第一の差算出手段と、最後に算出された第一の差を記憶する第一の差記憶手段と、前記第一の差算出手段が算出した第一の差と、前記第一の差記憶手段に記憶された第一の差との差である第二の差を算出する第二の差算出手段と、を有する。   The present invention is a core monitoring device that receives notifications from a plurality of cores in a common cycle, and when receiving notifications from the cores, a core identification value generation unit that generates a core identification value unique to each core for each core; A total value calculating means for calculating a total value obtained by summing the core identification values of a plurality of cores, a total value storing means for storing the last calculated total value, and a total value calculated by the total value calculating means First difference calculation means for calculating a first difference that is a difference from the total value stored in the total value storage means, and first difference storage means for storing the first difference calculated last. And a second difference calculation for calculating a second difference which is a difference between the first difference calculated by the first difference calculation means and the first difference stored in the first difference storage means. Means.

マルチコアマイコンにおいて、異常の生じたコアをソフト的な負荷増大を抑制して判別可能なコア監視装置を提供できる。   In a multi-core microcomputer, it is possible to provide a core monitoring device capable of discriminating an abnormal core while suppressing a software load increase.

マイコンの概略的な特徴を説明する図の一例である。It is an example of the figure explaining the general | schematic characteristic of a microcomputer. 車両に搭載されるマイコンのハードウェア構成図の一例である。It is an example of the hardware block diagram of the microcomputer mounted in a vehicle. コア1〜nのタスクとカウンタ履歴部の関係を模式的に説明する図の一例である。It is an example of the figure which illustrates typically the relation between the task of cores 1-n, and a counter history part. カウンタ履歴部の構成例の一例を示す図である。It is a figure which shows an example of a structural example of a counter log | history part. カウンタ履歴部の構成例の一例を示す図である。It is a figure which shows an example of a structural example of a counter log | history part. カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。It is a figure explaining an example of transition of a counter value, an integrated value, a total value, the 1st difference, and the 2nd difference. コアが4つの場合のカウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。It is a figure explaining an example of transition of a counter value, a total value, a total value, the 1st difference, and the 2nd difference in case of four cores. IDが不連続の場合の、カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。It is a figure explaining an example of transition of a counter value, integrated value, total value, the 1st difference, and the 2nd difference in case ID is discontinuous. 複数のコアが同時に暴走した場合の、カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。It is a figure explaining an example of transition of a counter value, a total value, a total value, the 1st difference, and the 2nd difference when a plurality of cores run away simultaneously. カウンタ履歴部の構成例の一例を示す図である。It is a figure which shows an example of a structural example of a counter log | history part. カウンタ履歴部の構成例の一例を示す図である。It is a figure which shows an example of a structural example of a counter log | history part.

以下、本発明を実施するための形態について図面を参照しながら説明する。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.

図1は、本実施形態のマイコンの概略的な特徴を説明する図の一例である。まず、前提として、複数のコアを有するマルチコアマイコンでは、OS(Operating System)やコア同士が他のコアを識別するために、各コアにそれぞれ一意のIDが割り当てられている。
(i) 3つのコア1〜3はそれぞれソフト的に実装されているカウンタを有し、同じ周期でそれぞれが独立にカウントアップしている。カウントされた値をカウンタ値という。
(ii) コア1〜3は「カウンタ値×ID」を計算する。IDが異なるので、カウンタ値が同じでも計算結果はコア毎に異なる。
(iii) ウォッチドッグタイマを代替する回路(後述するカウンタ履歴部)は以下の計算を行う。
・コア1〜3から通知された計算結果の合計値を算出する。
・前回と今回の合計値の差である第1差を算出する。
・前回と今回の第1差の差である第2差を算出する。
FIG. 1 is an example of a diagram illustrating schematic features of the microcomputer according to the present embodiment. First, as a premise, in a multi-core microcomputer having a plurality of cores, each core is assigned a unique ID so that the OS (Operating System) and the cores identify each other.
(i) Each of the three cores 1 to 3 has a counter mounted in software, and each counts up independently in the same cycle. The counted value is called a counter value.
(ii) The cores 1 to 3 calculate “counter value × ID”. Since the ID is different, the calculation result is different for each core even if the counter value is the same.
(iii) A circuit that replaces the watchdog timer (a counter history section described later) performs the following calculation.
-Calculate the total value of the calculation results notified from the cores 1 to 3.
Calculate the first difference that is the difference between the previous and current total values.
Calculate the second difference, which is the difference between the first difference and the previous difference.

図1(a)に示すように、1つもコアが暴走していない場合、第1差には常に“6”が、第2差には常に“0”が得られる。
(iv) 例えば、コア2が暴走した場合、コア2は「カウンタ値×ID」を更新できないので、上記回路におけるコア2の計算結果は“4”のままとなる。
(v) したがって、コア2の暴走により合計値は正常時の合計値よりも小さくなる。第1差も、コア2が「カウンタ値×ID」を更新しない分、小さくなる。ここで、第1差の減少分はコア2のIDに等しくなる。このため、図1(b)に示すように、第2差に暴走したコアのIDが得られることになる。
As shown in FIG. 1A, when no core is running out of control, “6” is always obtained for the first difference and “0” is always obtained for the second difference.
(iv) For example, when the core 2 runs out of control, the core 2 cannot update “counter value × ID”, so the calculation result of the core 2 in the above circuit remains “4”.
(v) Therefore, the total value becomes smaller than the normal value due to the runaway of the core 2. The first difference is also reduced because the core 2 does not update “counter value × ID”. Here, the decrease in the first difference is equal to the ID of the core 2. For this reason, as shown in FIG. 1B, the ID of the core that has runaway in the second difference is obtained.

このように、暴走したコアは「カウンタ値×ID」を更新しないので合計値が小さくなり、第1差の減少分である第2差に暴走したコア2のコアIDが現れる。この第2差を各コアが参照すれば、各コアは暴走したコアを検知することができる。   Thus, since the runaway core does not update “counter value × ID”, the total value becomes small, and the core ID of the runaway core 2 appears in the second difference, which is the decrease of the first difference. If each core refers to this second difference, each core can detect the runaway core.

〔構成例〕
図2は、車両に搭載されるマイコンのハードウェア構成図の一例である。マイコン100は、ECU(Electronic Control Unit)に搭載されることが想定されているがその用途は車両に限定されない。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等の種類がある。本実施例のマイコン100はECUの機能の違いに影響されず搭載されることが可能である。また、複数の機能が1つに統合されたECUにマイコン100を搭載してもよい。
[Configuration example]
FIG. 2 is an example of a hardware configuration diagram of a microcomputer mounted on the vehicle. The microcomputer 100 is assumed to be mounted on an ECU (Electronic Control Unit), but its application is not limited to a vehicle. There are various types of ECUs mounted on the vehicle, such as an engine ECU, a brake ECU, a body ECU, a navigation ECU (AV / information processing ECU), and a gateway ECU, depending on main functions. The microcomputer 100 of the present embodiment can be mounted without being affected by the difference in ECU functions. Further, the microcomputer 100 may be mounted on an ECU in which a plurality of functions are integrated into one.

マイコン100は、メインバス21に接続されたプロセッサ11、ROM12、INTC13、RAM14、DMAC15、並びに、I/Oブリッジ16を有し、I/Oブリッジ16には周辺バス22を介してカウンタ履歴部17、ADC(Analog to Digital Converter)18及びCANコントローラ19が接続されている。   The microcomputer 100 includes a processor 11, a ROM 12, an INTC 13, a RAM 14, a DMAC 15, and an I / O bridge 16 connected to the main bus 21. The counter history unit 17 is connected to the I / O bridge 16 via the peripheral bus 22. An ADC (Analog to Digital Converter) 18 and a CAN controller 19 are connected.

プロセッサ11は少なくとも2つ以上のコア1〜nを有すると共に、各コア1〜nは一般的な演算機能(例えば、ALU等の演算装置、命令バッファ、命令デコーダ、レジスタセット等)を有している。   The processor 11 has at least two or more cores 1 to n, and each of the cores 1 to n has a general arithmetic function (for example, an arithmetic device such as an ALU, an instruction buffer, an instruction decoder, a register set, etc.). Yes.

ROM12はフラッシュメモリなどの不揮発メモリであり、プロセッサ11が実行するプログラム30や初期値、パラメータ等を記憶している。   The ROM 12 is a nonvolatile memory such as a flash memory, and stores a program 30 executed by the processor 11, initial values, parameters, and the like.

INTC13はIRQやその他の割り込み端子を介して周辺機器から入力された割り込み要求を、周辺機器の優先順位に基づき調停してプロセッサ11に通知する。これによりプロセッサ11は、割り込みした周辺機器に応じて決まったアドレスの命令をROM12から読み出して処理を実行する。   The INTC 13 arbitrates based on the priority of the peripheral device and notifies the processor 11 of the interrupt request input from the peripheral device via the IRQ or other interrupt terminal. As a result, the processor 11 reads an instruction at an address determined according to the interrupted peripheral device from the ROM 12 and executes the process.

RAM14は、プロセッサ11がプログラム30を実行するための作業領域である。プロセッサ11はROM12からプログラム30を読み込み、また、必要であればデータバスを介してRAM14からデータを読み出しプログラム30を実行する。DMAC15は、プロセッサ11からの指示によりRAM14からI/Oブリッジ16を介して周辺機器にデータを送信する。また、周辺機器から割り込みされたプロセッサ11から指示を受けて、I/Oブリッジ16を介して周辺機器からデータを受け取り、RAM14に書き込む。   The RAM 14 is a work area for the processor 11 to execute the program 30. The processor 11 reads the program 30 from the ROM 12, and reads the data from the RAM 14 via the data bus if necessary and executes the program 30. The DMAC 15 transmits data from the RAM 14 to the peripheral device via the I / O bridge 16 according to an instruction from the processor 11. In response to an instruction from the processor 11 interrupted by the peripheral device, data is received from the peripheral device via the I / O bridge 16 and written to the RAM 14.

I/Oブリッジ16は、マルチプレクサやブリッジ回路などであり、チャネル毎に、カウンタ履歴部17、ADC18、及び、CANコントローラ19とそれぞれ接続されており、これらの周辺機器とデータを送受信する。カウンタ履歴部17は、コア1〜nの「カウンタ値×ID」(又はカウンタ値)を取得して、合計値、第1差、及び、第2差を算出する。詳しくは後述する。   The I / O bridge 16 is a multiplexer, a bridge circuit, or the like, and is connected to the counter history unit 17, the ADC 18, and the CAN controller 19 for each channel, and transmits / receives data to / from these peripheral devices. The counter history unit 17 acquires “counter value × ID” (or counter value) of the cores 1 to n and calculates the total value, the first difference, and the second difference. Details will be described later.

ADC18は、各種のセンサが検出したアナログ信号をデジタル信号に変換する。ADC18は変換の終了を、INTC13を介してプロセッサ11に通知する。CANコントローラ19は、車載ネットワークを介して接続された他のECUと通信するための通信装置である。CANコントローラ19は、プロセッサ11から通信データの送信要求を受け付けるとフレームの各フィールドにCAN IDやデータを格納しCANバスに出力する。また、CANコントローラ19は、受信すべきCAN IDの通信データを検出するとそれを取り込みINTC13を介してプロセッサ11に割り込んで通知する。   The ADC 18 converts analog signals detected by various sensors into digital signals. The ADC 18 notifies the end of conversion to the processor 11 via the INTC 13. The CAN controller 19 is a communication device for communicating with other ECUs connected via an in-vehicle network. When receiving a communication data transmission request from the processor 11, the CAN controller 19 stores the CAN ID and data in each field of the frame and outputs them to the CAN bus. In addition, when the CAN controller 19 detects the communication data of the CAN ID to be received, the CAN controller 19 captures the data and interrupts it to the processor 11 via the INTC 13 to notify it.

なお、ウォッチドッグタイマとしては同じマイコン内にカウンタ履歴部17が搭載されていればよい。しかし、他のマイコン、又は、CAN(Controller Area Network)などの車載LANを介して接続された他のECUにカウンタ履歴部17が搭載されてもよい。この場合、複数のマイコンでカウンタ履歴部17を共用できる。   As the watchdog timer, the counter history unit 17 may be mounted in the same microcomputer. However, the counter history unit 17 may be mounted in another microcomputer or another ECU connected via an in-vehicle LAN such as a CAN (Controller Area Network). In this case, the counter history unit 17 can be shared by a plurality of microcomputers.

〔カウンタ値のカウントアップなどの処理〕
各コア1〜nはそれぞれ専用の車載装置の制御のため処理を行っている。この処理又はこの処理を実行するプログラムをメインタスクと称する。そして、一般的なウォッチドッグタイマによる異常監視では、ウォッチドッグタイマがオーバーフローしないように、コア1〜nが定期的にウォッチドッグタイマをリセットする。このリセットはアイドルタスクと称されるタスクの中で行われることが多い。本実施形態では、コアがアイドルタスクを実行してウォッチドッグタイマをリセットする代わりに、「カウンタ値×ID」(又はカウンタ値)を通知する処理を行う。
[Processing such as counting up the counter value]
Each of the cores 1 to n performs processing for controlling a dedicated in-vehicle device. This process or a program that executes this process is called a main task. In anomaly monitoring using a general watchdog timer, the cores 1 to n periodically reset the watchdog timer so that the watchdog timer does not overflow. This reset is often performed in a task called an idle task. In the present embodiment, instead of the core executing the idle task and resetting the watchdog timer, a process of notifying “counter value × ID” (or counter value) is performed.

図3は、コア1〜nのタスクとカウンタ履歴部17の関係を模式的に説明する図の一例である。カウンタ履歴部17は、図3にも示すように乗算器1〜nがある場合とない場合がある。   FIG. 3 is an example of a diagram for schematically explaining the relationship between the tasks of the cores 1 to n and the counter history unit 17. As shown in FIG. 3, the counter history unit 17 may or may not have multipliers 1 to n.

コア1〜nには、重複しないIDが付与されている。IDは、マイコン100の起動時にOS又はプログラム30が初期処理として各コア1〜nのコアIDレジスタ40に登録する。IDはコア毎に固定であるが、初期処理の度に異なっていてもよい。また、図示するように連番である必要もない。   Non-overlapping IDs are assigned to the cores 1 to n. The ID is registered in the core ID register 40 of each of the cores 1 to n by the OS or the program 30 as an initial process when the microcomputer 100 is activated. The ID is fixed for each core, but may be different for each initial process. Moreover, it is not necessary to be a serial number as shown.

タイマ41は予め設定された時間間隔(例えば数ミリ秒)毎に周期的にプロセッサ11に割込みする。各コア1〜nは割込みによりメインタスクを実行する。コア1〜nはメインタスクの実行を終了すると、続いてアイドルタスクを実行する。各コアが行うメインタスクは処理内容が異なっているので、同じ周期でメインタスクを実行しても実行完了タイミングは異なる可能性がある。しかし、メインタスクとアイドルタスクが実行される頻度は各コア1〜nに共通になる。   The timer 41 periodically interrupts the processor 11 at predetermined time intervals (for example, several milliseconds). Each core 1 to n executes the main task by interruption. When the cores 1 to n finish executing the main task, the cores 1 to n subsequently execute the idle task. Since the main task performed by each core has different processing contents, the execution completion timing may be different even if the main task is executed in the same cycle. However, the frequency with which the main task and the idle task are executed is common to the cores 1 to n.

したがって、各コア1〜nは共通の周期でアイドルタスクを実行する。すなわち、各コア1〜nが実行するメインタスクが異なっていても、アイドルタスクがカウンタ値をカウントアップする頻度は共通である。   Therefore, each of the cores 1 to n executes an idle task with a common period. That is, even if the main tasks executed by the cores 1 to n are different, the frequency with which the idle task counts up the counter value is common.

アイドルタスクは、ウォッチドッグタイマをリセットする処理の代わりに、カウンタ値を決まった値だけカウントアップする処理を行う。カウンタ値のカウントアップは各コアに共通なので、コアが暴走しなければカウンタ値1〜nはコア1〜nにおいて等しくなる。1回のカウントアップ量は、各コアに共通の自然数ならいくつでもよいがここでは“1”とする。したがって、カウンタ値はアイドルタスクが呼び出される毎に1つ大きくなる。   The idle task performs a process of counting up the counter value by a predetermined value instead of the process of resetting the watchdog timer. Since the count up of the counter value is common to each core, the counter values 1 to n are equal in the cores 1 to n if the core does not run away. The number of count-ups per time may be any number as long as it is a natural number common to each core, but is assumed to be “1” here. Therefore, the counter value increases by one every time the idle task is called.

アイドルタスクは、自己の「カウンタ値×ID」をカウンタ履歴部17に通知する。または、アイドルタスクは、自己のIDと共にカウンタ値をカウンタ履歴部17に通知する。このように、「カウンタ値×ID」の処理は、各コア1〜nを識別するための処理となるが、コアとカウンタ履歴部17のどちらが行ってもよい。詳しくは後述する。   The idle task notifies the counter history unit 17 of its own “counter value × ID”. Alternatively, the idle task notifies the counter history unit 17 of the counter value together with its own ID. As described above, the “counter value × ID” process is a process for identifying each of the cores 1 to n, but either the core or the counter history unit 17 may perform the process. Details will be described later.

アイドルタスクは、カウンタ値をコア1〜nのローカルRAMやレジスタに記憶し、この後、他に処理がなければコア1〜nはアイドルタスクを終了する。次回、メインタスクが周期割込みにより起動されると、アイドルタスクは最後に記憶したカウンタ値を読み出して、カウントアップする処理を再度、行う。   The idle task stores the counter value in the local RAMs and registers of the cores 1 to n, and thereafter, if there is no other processing, the cores 1 to n end the idle task. Next time, when the main task is activated by a periodic interrupt, the idle task reads the last stored counter value and performs the process of counting up again.

なお、コア1〜nからカウンタ履歴部17へのアクセスは、メインバス21、I/Oブリッジ16、周辺バス22、カウンタ履歴部17の順である。逆に、カウンタ履歴部17がプロセッサ11にアクセスする場合は、INTC13、プロセッサ11の順となる。   The access from the cores 1 to n to the counter history unit 17 is in the order of the main bus 21, the I / O bridge 16, the peripheral bus 22, and the counter history unit 17. Conversely, when the counter history unit 17 accesses the processor 11, the INTC 13 and the processor 11 are in this order.

また、必ずしも、アイドルタスクはメインタスクから呼び出されて実行される必要はなく、メインタスクの中でカウンタ値を積算してもよい。また、アイドルタスクが、周期的な割込みで、直接、起動されてもよい。   In addition, the idle task is not necessarily called from the main task and executed, and the counter value may be accumulated in the main task. Further, the idle task may be directly activated by a periodic interrupt.

〔カウンタ履歴部の構成例1〕
図4は、カウンタ履歴部17の構成例の一例を示す図である。図4の構成は、カウンタ履歴部17が「カウンタ値×ID」を算出する場合の構成である。
[Configuration Example 1 of Counter History Section]
FIG. 4 is a diagram illustrating an example of a configuration example of the counter history unit 17. The configuration of FIG. 4 is a configuration when the counter history unit 17 calculates “counter value × ID”.

カウンタ履歴部17は、乗算器31(区別する場合、乗算器1〜nという)、加算器32、減算器33、合計値記憶部36、第1差記憶部37、第2差記憶部38、比較器35、及び、コアID公開用レジスタ39を有する。なお、乗算器31、加算器32及び減算器33,34は、説明の都合上、別々に図示したものであり加算・減算・乗算が可能な一体の演算器により構成してもよい。   The counter history unit 17 includes a multiplier 31 (referred to as multipliers 1 to n when distinguished), an adder 32, a subtractor 33, a total value storage unit 36, a first difference storage unit 37, a second difference storage unit 38, A comparator 35 and a core ID disclosure register 39 are included. Note that the multiplier 31, the adder 32, and the subtractors 33 and 34 are illustrated separately for convenience of explanation, and may be configured by an integrated arithmetic unit capable of addition, subtraction, and multiplication.

乗算器1〜nには、コア1〜nから送出されたカウンタ値、及び、コア1〜nのID1〜nが供給される。乗算器1〜nは、コア毎にコアのカウンタ値とコアのIDの乗算を行い、それぞれを加算器32に供給する。   The counter values sent from the cores 1 to n and the IDs 1 to n of the cores 1 to n are supplied to the multipliers 1 to n. The multipliers 1 to n multiply the core counter value and the core ID for each core, and supply each to the adder 32.

加算器32は、全ての乗算器1〜nの乗算結果を加算する。この加算結果が合計値である。加算器32は、最新の合計値を減算器33に供給する。   The adder 32 adds the multiplication results of all the multipliers 1 to n. This addition result is the total value. The adder 32 supplies the latest total value to the subtracter 33.

次に、減算器33は以下の処理を行う。
・合計値記憶部36から、前回の合計値を読み出す。
・加算器32から取得した最新の合計値を合計値記憶部36に記憶する。
・最新の合計値から前回の合計値を減じる。
この減算結果が第1差である。減算器33は、最新の第1差を減算器34に供給する。
Next, the subtractor 33 performs the following processing.
Read the previous total value from the total value storage unit 36.
The latest total value acquired from the adder 32 is stored in the total value storage unit 36.
-Subtract the previous total from the latest total.
This subtraction result is the first difference. The subtractor 33 supplies the latest first difference to the subtracter 34.

次に、減算器34は以下の処理を行う。
・第1差記憶部37から、前回の第1差を読み出す。
・減算器34から取得した最新の第1差を第1差記憶部37に記憶する。
・最新の第1差から前回の第1差を減じて絶対値を求める。
この減算結果が第2差である。
Next, the subtractor 34 performs the following processing.
Reads the previous first difference from the first difference storage unit 37.
The latest first difference acquired from the subtracter 34 is stored in the first difference storage unit 37.
-The absolute value is obtained by subtracting the previous first difference from the latest first difference.
This subtraction result is the second difference.

次に、比較器35は、第2差がゼロか否かを判定する。ゼロの場合、コア1〜nに暴走したコアはなく、各コア1〜nが正常にカウンタ値をカウントアップしていることになる。よって、カウンタ履歴部17は、特に何もする必要はないが、図では比較用に第2差を第2差記憶部38に記憶している。   Next, the comparator 35 determines whether or not the second difference is zero. In the case of zero, there is no runaway core in cores 1 to n, and each core 1 to n is normally counting up the counter value. Therefore, the counter history unit 17 does not need to do anything, but in the figure, the second difference is stored in the second difference storage unit 38 for comparison.

第2差がゼロでない場合、コア1〜nに暴走したコアがあることになる。このため、比較器35は、第2差をコアID公開用レジスタ39に記憶する。コアID公開用レジスタ39は、各コアが参照することが記憶手段(例えば、レジスタ)である。第2差がゼロ以外になった場合、第2差は暴走したコアのコアIDになるので、各コア1〜nは、どのコアが暴走したかを容易に判別することができる。   When the second difference is not zero, the cores 1 to n have runaway cores. For this reason, the comparator 35 stores the second difference in the core ID disclosure register 39. The core ID disclosure register 39 is a storage means (for example, a register) that each core refers to. When the second difference is other than zero, the second difference becomes the core ID of the runaway core, so that each of the cores 1 to n can easily determine which core has runaway.

カウンタ履歴部17は、ウォッチドッグタイマと同様に、第2差がゼロでない場合、以下のような処理を行う。
(a)プロセッサ11に割込み信号を出力する。これによりプロセッサ11の各コア1〜nは割込みに対応した処理として、例えば、コアID公開用レジスタ39から第2差(コアID)を読み出し、暴走したコアを特定する。また、暴走したコアに応じたフェールセーフ処理(別のコアに処理を振り分ける、マスターを切り換える等)を行うことができる。
(b)CANコントローラ19を介して他のECUに通知する。
(c)電源を遮断する。暴走したコアをリセットする(コアのみをリセットする内部リセット)。
Similarly to the watchdog timer, the counter history unit 17 performs the following process when the second difference is not zero.
(A) An interrupt signal is output to the processor 11. As a result, each of the cores 1 to n of the processor 11 reads out the second difference (core ID) from the core ID disclosure register 39 as a process corresponding to the interrupt, and identifies the runaway core. Also, fail-safe processing (distributing processing to another core, switching masters, etc.) according to the runaway core can be performed.
(B) Notifying another ECU via the CAN controller 19.
(C) Shut off the power supply. Reset the runaway core (internal reset that resets only the core).

このように、アイドルタスクに、ウォッチドッグタイマのリセットの代わりにカウンタ値をカウントさせる処理を行わせるだけで、ほとんどソフト的な処理負荷を増大させることなく、各コア1〜nが暴走したコアを特定できる。コアの数が何個でも、1つのカウンタ履歴部17があればよい。   In this way, the core in which each of the cores 1 to n runs out of control without increasing the software processing load almost simply by causing the idle task to perform the process of counting the counter value instead of resetting the watchdog timer. Can be identified. Any number of cores may be used as long as there is one counter history unit 17.

〔カウンタ履歴部の構成例2〕
図5は、カウンタ履歴部17の構成例の一例を示す図である。図5の構成は、各コアのアイドルタスクが「カウンタ値×ID」を算出する場合の構成である。このため、図5のカウンタ履歴部17は、乗算器1〜nを有さない。それ以外の構成は図4と同様である。
[Configuration Example 2 of Counter History Section]
FIG. 5 is a diagram illustrating an example of a configuration example of the counter history unit 17. The configuration of FIG. 5 is a configuration when the idle task of each core calculates “counter value × ID”. For this reason, the counter history unit 17 in FIG. 5 does not have the multipliers 1 to n. The other configuration is the same as that of FIG.

加算器32には、コア1〜nから送出された「カウンタ値×ID」の計算結果が供給される。加算器32は、全てのコア1〜nの「カウンタ値×ID」の計算結果を加算する。この加算結果が合計値である。加算器32は、最新の合計値を減算器33に供給する。   The adder 32 is supplied with the calculation result of “counter value × ID” sent from the cores 1 to n. The adder 32 adds the calculation results of “counter value × ID” of all the cores 1 to n. This addition result is the total value. The adder 32 supplies the latest total value to the subtracter 33.

以降の処理、すなわち、減算器33、減算器34、及び、比較器35による処理は図4と同様なので説明を省略する。   Subsequent processing, that is, processing by the subtractor 33, subtractor 34, and comparator 35 is the same as that in FIG.

図5と図4を比較すると、図5ではn個の乗算器1〜nが不要なので、カウンタ履歴部17の回路規模を小さくできる。したがって、コア数が多く、乗算器1〜nを集約できないような場合は、図5の態様の方が有効である。   Comparing FIG. 5 and FIG. 4, since n multipliers 1 to n are unnecessary in FIG. 5, the circuit scale of the counter history unit 17 can be reduced. Therefore, when the number of cores is large and the multipliers 1 to n cannot be aggregated, the aspect of FIG. 5 is more effective.

〔カウンタ値などの遷移〕
図6は、カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。左図は正常時の遷移を、右図はコア2が暴走した際の遷移をそれぞれ示す。なお、各コア1〜nが「カウンタ値×ID」又は「カウンタ値」のどちらを送信するかは、カウンタ値の遷移に影響しない。
[Transition of counter value, etc.]
FIG. 6 is a diagram for explaining an example of the transition of the counter value, the integrated value, the total value, the first difference, and the second difference. The left figure shows the transition when normal, and the right figure shows the transition when the core 2 runs away. Note that whether each core 1 to n transmits “counter value × ID” or “counter value” does not affect the transition of the counter value.

時刻t0〜t4毎にカウンタ値、積算値、合計値、第1差、第2差が図示されている。時刻t0〜t4はタイマ41が各コア1〜nに周期的に割込みする間隔(例えば、数ミリ秒)の経過を表す。カウンタ値「1,2,3,4,5」は時刻が経過する毎に1つずつ大きくなっている。カウンタ値は1つしかないが、実際には各コア1〜nが周期的な割込みで同期するので、各アイドルタスクがそれぞれカウンタ値をカウントしている。   A counter value, an integrated value, a total value, a first difference, and a second difference are illustrated for each time t0 to t4. Times t0 to t4 represent the elapse of an interval (for example, several milliseconds) at which the timer 41 periodically interrupts each of the cores 1 to n. The counter value “1, 2, 3, 4, 5” increases by one each time. Although there is only one counter value, each of the cores 1 to n is actually synchronized by a periodic interrupt, so that each idle task counts the counter value.

コア1又は乗算器1は、「ID:1×カウンタ値」を周期的に計算するので、計算結果は「1、2,3,4,5」となる。   Since the core 1 or the multiplier 1 periodically calculates “ID: 1 × counter value”, the calculation result is “1, 2, 3, 4, 5”.

コア2又は乗算器2は、「ID:2×カウンタ値」を周期的に計算するので、計算結果は「2、4,6,8,10」となる。   Since the core 2 or the multiplier 2 periodically calculates “ID: 2 × counter value”, the calculation result is “2, 4, 6, 8, 10”.

コア3又は乗算器3は、「ID:3×カウンタ値」を周期的に計算するので、計算結果は「3、6,9,12,15」となる。   Since the core 3 or the multiplier 3 periodically calculates “ID: 3 × counter value”, the calculation result is “3, 6, 9, 12, 15”.

また、合計値は、時刻t0〜t4毎の積算値の合計なので、「6、12,18,24,30」のように“6”ずつ増える等差級数(初項6、公差6)となる。したがって、第1差は、公差“6”が常に現れる「6,6,6,6,6」となる。このため、第2差は常に“0”となるが、時刻t0では演算対象の第1差がないので算出しないものとする。したがって、「−,0,0,0,0」となる。   Further, since the total value is the sum of the integrated values at times t0 to t4, it becomes an equality series (first term 6, tolerance 6) that increases by “6”, such as “6, 12, 18, 24, 30”. . Therefore, the first difference is “6, 6, 6, 6, 6” in which the tolerance “6” always appears. For this reason, the second difference is always “0”, but it is not calculated because there is no first difference to be calculated at time t0. Therefore, “−, 0, 0, 0, 0” is obtained.

このように、コアが暴走しなければ、第1差が常に公差の“6”となるので、第2差は“0”となり、カウンタ履歴部17はコアが暴走していないことを確認できる。   Thus, if the core does not run away, the first difference is always the tolerance “6”, so the second difference is “0”, and the counter history unit 17 can confirm that the core is not running away.

次に、コア1〜nのいずれかが暴走した場合について説明する。ここではコア2が時刻t2〜t3の間に暴走したものとする。コア1,3のカウンタ値等は図6の左図にて説明したとおりである。これに対し、コア2は暴走したため、アイドルタスクがカウンタ値のカウントアップをできず、コア2のカウンタ値は「1,2,3,3,3」となる(不図示)。また、コア2が暴走すると、カウンタ履歴部17にカウンタ値(又は、ID:2×カウンタ値)を通知することもできない。したがって、コア2の暴走後は、時刻の経過に関わりなく加算器32に“6”が供給される。   Next, a case where any one of the cores 1 to n runs away will be described. Here, it is assumed that the core 2 runs away from time t2 to t3. The counter values of the cores 1 and 3 are as described in the left diagram of FIG. On the other hand, since the core 2 has run away, the idle task cannot count up the counter value, and the counter value of the core 2 becomes “1, 2, 3, 3, 3” (not shown). Further, if the core 2 runs away, the counter history unit 17 cannot be notified of the counter value (or ID: 2 × counter value). Therefore, after the runaway of the core 2, “6” is supplied to the adder 32 regardless of the passage of time.

このため、合計値は「6、12,18,22,26」となり、時刻t3以降の公差が4となる。公差が“6”から“4”に減少するのは、コア2の「ID:2×カウンタ値」が更新されないためである。   Therefore, the total value is “6, 12, 18, 22, 26”, and the tolerance after time t3 is 4. The reason why the tolerance decreases from “6” to “4” is because “ID: 2 × counter value” of the core 2 is not updated.

時刻t3で合計値が減少したため、時刻t3、t4の第1差も小さくなり「6,6,6,4,4」となる。この結果、第2差は「−,0,0,2,0」となる。コア2が暴走した直後の時刻t3でのみ第2差に“2”が現れる。この“2”は、コア2のID(=2)に他ならない。   Since the total value has decreased at time t3, the first difference between times t3 and t4 is also reduced to “6, 6, 6, 4, 4”. As a result, the second difference is “−, 0, 0, 2, 0”. “2” appears in the second difference only at time t3 immediately after the core 2 runs away. This “2” is nothing but the ID of the core 2 (= 2).

したがって、カウンタ履歴部17は、第2差が“0”以外となった時刻によりコアの暴走タイミングを特定でき、第2差の値により暴走したコアを特定することができる。カウンタ履歴部17は、第2差の値をコアID公開用レジスタ39に記憶するので、他の暴走していないコア1,3が暴走したコア2を検知することができる。   Therefore, the counter history unit 17 can specify the runaway timing of the core based on the time when the second difference becomes other than “0”, and can identify the core that has runaway based on the value of the second difference. Since the counter history unit 17 stores the value of the second difference in the core ID disclosure register 39, it is possible to detect the core 2 in which the other non-runaway cores 1 and 3 have runaway.

図7は、コア1〜nが4つの場合のカウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。左図は正常時の遷移を、右図はコア4が暴走した際の遷移をそれぞれ示す。   FIG. 7 is a diagram for explaining an example of the transition of the counter value, integrated value, total value, first difference, and second difference when there are four cores 1 to n. The left figure shows the transition when normal, and the right figure shows the transition when the core 4 runs away.

コア1〜nが暴走しない場合の遷移は図6の左図と同様なので簡単に説明する。
合計値は、「10,20,30,40,50」のように“10”ずつ増える等差級数(初項10、公差10)となる。したがって、第1差には公差“10”が常に現れる「10,10,10,10,10」となる。このため、第2差は「−,0,0,0,0」となる。
Since the transition when the cores 1 to n do not run away is the same as the left diagram of FIG.
The total value is an arithmetic series (first term 10, tolerance 10) that increases by “10”, such as “10, 20, 30, 40, 50”. Therefore, the tolerance “10” always appears in the first difference as “10, 10, 10, 10, 10”. Therefore, the second difference is “−, 0, 0, 0, 0”.

次に、コア4が時刻t1〜t2の間に暴走したものとする。コア1〜3のカウンタ値等は図7の左図にて説明したとおりである。これに対し、コア4は暴走したためアイドルタスクがカウンタ値をカウントアップできず、コア4のカウンタ値は「1,2,2,2,2」となる(不図示)。また、コア4が暴走すると、カウンタ履歴部17にカウンタ値(又は、ID=4×カウンタ値)を通知することもできない。したがって、加算器32には時刻の経過に関わりなく“8”が供給される。   Next, it is assumed that the core 4 has runaway between times t1 and t2. The counter values of the cores 1 to 3 are as described in the left diagram of FIG. On the other hand, since the core 4 has runaway, the idle task cannot count up the counter value, and the counter value of the core 4 becomes “1, 2, 2, 2, 2” (not shown). If the core 4 runs away, the counter history unit 17 cannot be notified of the counter value (or ID = 4 × counter value). Therefore, “8” is supplied to the adder 32 regardless of the passage of time.

このため、合計値は「10、20,26,32,38」となり、時刻t2以降の公差が6となる。公差が“10”から“6”に減少するのは、コア4の積算値が更新されないためである。   Therefore, the total value is “10, 20, 26, 32, 38”, and the tolerance after time t2 is 6. The reason why the tolerance decreases from “10” to “6” is because the integrated value of the core 4 is not updated.

時刻t2で合計値が減少したため、時刻t2、t3、t4の第1差も小さくなり「10,10,6、6,6」となる。この結果、第2差は「−,0,4,0,0」となる。コア4が暴走した直後の時刻t2でのみ第2差に“4”が現れる。この“4”はコア4のID(=4)に他ならない。したがって、コアの数に関係なく、暴走したコア及びそのタイミングを特定できることが分かる。   Since the total value decreased at time t2, the first difference between times t2, t3, and t4 is also reduced to “10, 10, 6, 6, 6”. As a result, the second difference is “−, 0, 4, 0, 0”. “4” appears in the second difference only at time t2 immediately after the core 4 runs away. This “4” is nothing but the ID of the core 4 (= 4). Therefore, it can be seen that the runaway core and its timing can be specified regardless of the number of cores.

図8は、IDが不連続の場合の、カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。左図は正常時の遷移を、右図はコア2が暴走した際の遷移をそれぞれ示す。正常時の場合の遷移については説明を省略する。   FIG. 8 is a diagram for explaining an example of the transition of the counter value, the integrated value, the total value, the first difference, and the second difference when the ID is discontinuous. The left figure shows the transition when normal, and the right figure shows the transition when the core 2 runs away. A description of the transition in the normal state is omitted.

図ではコア1〜3のIDがそれぞれ6、11,101となっている。コア2が時刻t2〜t3の間に暴走した場合、コア2は暴走したためカウンタ値のカウントアップができず、コア2のカウンタ値は「11,22,33,33,33」となる。したがって、加算器32には時刻の経過に関わりなく“33”が供給される。   In the figure, the IDs of the cores 1 to 3 are 6, 11, and 101, respectively. When the core 2 runs away between times t2 and t3, the counter value of the core 2 becomes “11, 22, 33, 33, 33” because the core 2 has runaway and cannot count up. Therefore, “33” is supplied to the adder 32 regardless of the passage of time.

このため、合計値は「118、236,354,461,568」となり、時刻t3以降の公差が“107”となる。公差が“118”から“107”に減少するのは、コア2の積算値が更新されないためである。   Therefore, the total value is “118, 236, 354, 461, 568”, and the tolerance after time t3 is “107”. The reason why the tolerance decreases from “118” to “107” is because the integrated value of the core 2 is not updated.

時刻t3で合計値が減少したため、時刻t3、t4の第1差も小さくなり「118,118,118、107,107」となる。この結果、第2差は「−,0,0,11,0」となる。コア2が暴走した直後の時刻t2でのみ第2差に“11”が現れる。この“11”はコア2のID=11に他ならない。したがって、コア1〜nに付与されるIDが一意であればそのIDの値に関係なく、暴走したコア及びそのタイミングを特定できることが分かる。   Since the total value decreased at time t3, the first difference between times t3 and t4 is also reduced to “118, 118, 118, 107, 107”. As a result, the second difference is “−, 0, 0, 11, 0”. “11” appears in the second difference only at time t2 immediately after the core 2 runs away. This “11” is nothing but the ID 2 of the core 2. Therefore, if the IDs given to the cores 1 to n are unique, the runaway core and its timing can be identified regardless of the value of the ID.

図9は、複数のコアが同時に暴走した場合の、カウンタ値、積算値、合計値、第1差、第2差の遷移の一例を説明する図である。図9では左図と右図のいずれもコア1,2が暴走した場合の遷移を示している。   FIG. 9 is a diagram for explaining an example of the transition of the counter value, integrated value, total value, first difference, and second difference when a plurality of cores run away simultaneously. In FIG. 9, both the left diagram and the right diagram show transitions when the cores 1 and 2 run away.

左図ではコア1〜3のIDはそれぞれID=1,2,3である。時刻t3〜t4の間に、コア1,2が共に暴走したとする。これまで説明したように、コアが暴走することで暴走したコアのIDが第2差に表れるが、複数のコアが同時に暴走した場合は暴走した複数のコアのIDの合計が第2差に表れる。このため、時刻t3の第2差は“3”となっている。   In the left figure, the IDs of the cores 1 to 3 are ID = 1, 2, and 3, respectively. Assume that both cores 1 and 2 run away between times t3 and t4. As described above, the ID of the core that has runaway due to the runaway of the core appears in the second difference, but when multiple cores run away at the same time, the total of the IDs of the multiple runaway cores appears in the second difference . For this reason, the second difference at time t3 is “3”.

しかし、コア3のIDが“3”であるため、コア3はコア3自身が暴走したと誤検知する可能性がある。このような誤検知は、開発者等がコア1〜nのIDを調整することで回避できる。   However, since the ID of the core 3 is “3”, the core 3 may erroneously detect that the core 3 has run away. Such false detection can be avoided by adjusting the IDs of the cores 1 to n by a developer or the like.

図9の右図では、コア1〜3のIDをそれぞれID=1,2,4とした。同様に、時刻t3〜t4の間に、コア1,2が共に暴走したとすると、時刻t3の第2差は“3”となる。IDが“3”となるコアは存在しないため、コア3はIDの合計が“3”となる2つのコア(コア1,2)が暴走したと検知することができる。IDの合計が“3”となるIDの組み合わせは“1”と“2”しかない。よって、コア3は、コア1,2が暴走したと検知することができる。   In the right diagram of FIG. 9, the IDs of the cores 1 to 3 are ID = 1, 2, and 4, respectively. Similarly, if the cores 1 and 2 run out of control between times t3 and t4, the second difference at time t3 is “3”. Since there is no core whose ID is “3”, the core 3 can detect that two cores (cores 1 and 2) whose total ID is “3” have runaway. There are only “1” and “2” combinations of IDs for which the total ID is “3”. Therefore, the core 3 can detect that the cores 1 and 2 have run away.

同様に、同時に暴走した複数のコアを特定することができる。
・コア1と3が暴走した場合、第2差は“5”となるが、ID=5のコアはなく、IDの合計が“5”となるIDの組み合わせは“1”と“4”しかない。よって、コア2は、コア1,3が暴走したと検知することができる。
・コア2と3が暴走した場合、第2差は“6”となるが、ID=6のコアはなく、IDの合計が“6”となるIDの組み合わせは“2”と“4”しかない。よって、コア1はコア2、3が暴走したことを検知できる。
Similarly, multiple cores that have runaway at the same time can be identified.
・ When cores 1 and 3 runaway, the second difference is “5”, but there is no core with ID = 5, and the combination of IDs where the total ID is “5” is only “1” and “4” Absent. Therefore, the core 2 can detect that the cores 1 and 3 have run away.
・ When cores 2 and 3 run away, the second difference is “6”, but there is no core with ID = 6, and the combination of IDs with a total ID of “6” is only “2” and “4” Absent. Therefore, the core 1 can detect that the cores 2 and 3 have run away.

このように、コア1〜nのIDを適切に設定しておくことで複数のコアの暴走にも対応することができる。具体的には、任意の2組のコアのIDの合計が、他のコアのIDと一致しないように、開発者等が各コア1〜nのIDを設定する。3つ以上のコアが同時に暴走した場合についても、任意の3組のコアのIDの合計が、他のコアのIDと一致しないように、各コアのIDを設定すればよい。   Thus, it is possible to cope with the runaway of a plurality of cores by appropriately setting the IDs of the cores 1 to n. Specifically, the developer or the like sets the IDs of the cores 1 to n so that the sum of the IDs of any two sets of cores does not match the IDs of the other cores. Even when three or more cores run away at the same time, the ID of each core may be set so that the sum of the IDs of any three sets of cores does not match the IDs of other cores.

なお、カウンタ値は1つずつインクリメントされるので、第2差にIDが現れるが、カウンタ値は2つずつインクリメントされてもよい。この場合、第2差に暴走したコアのID×2が現れる。よって、各コア1〜nは第2差を“2”で除すれば、暴走したコアのIDが得られる。このように、インクリメント値が一定でかつ既知であれば、カウンタ値の1回のカウントアップ分は“1”でなくてもよい。   Since the counter value is incremented by one, ID appears in the second difference, but the counter value may be incremented by two. In this case, the ID × 2 of the runaway core appears in the second difference. Therefore, if each core 1 to n is divided by “2”, the ID of the runaway core can be obtained. As described above, if the increment value is constant and known, the count value for one count-up may not be “1”.

〔マスター/スレーブの切り換え〕
マルチコアのマイコン100では、複数のコアのいずれか1つをマスターに、残りをスレーブに設定して、マスターがスレーブを監視するなどの構成を採ることがある。この場合、マスターが暴走すると、スレーブを監視するコアがなくなりコアの監視が行われない等の不都合が生じるおそれがある。
[Switching between master and slave]
The multi-core microcomputer 100 may employ a configuration in which one of a plurality of cores is set as a master and the rest are set as slaves, and the master monitors the slaves. In this case, if the master goes out of control, there is a possibility that inconveniences such as the absence of the core monitoring the slave and the monitoring of the core are not performed.

一般には、各コア1〜nは次のようにしてマスターのコアを決定する。例えば、各コア1〜nは、起動時に他のコアのIDを参照して(交換して)、最も小さいコアがマスターを引き受ける。したがって、コアID=1のコア(コア1とする)があれば、ID=1のコア1がマスターを引き受ける。コア1はマスターのコアIDを記憶するレジスタに自己のIDを記憶すると共に、他のコア2〜nにマスターのコア1のID(=1)を通知する。各コア2〜nは、マスターであるコアのコアIDを記憶するレジスタにコア1のID=1を記憶する。   In general, each of the cores 1 to n determines a master core as follows. For example, each of the cores 1 to n refers to (exchanges) the IDs of other cores at the time of activation, and the smallest core takes over the master. Therefore, if there is a core with core ID = 1 (referred to as core 1), core 1 with ID = 1 takes over the master. The core 1 stores its own ID in a register that stores the master core ID, and notifies the other cores 2 to n of the ID (= 1) of the master core 1. Each of the cores 2 to n stores ID = 1 of the core 1 in a register that stores the core ID of the core that is the master.

コア1が暴走した場合、他のコア2〜nはコアID公開用レジスタ39を参照して、コア1が暴走したことを検知する。暴走したコア1は、電源が遮断されるか又はリセットされる。コア1がリセットされた場合、コア1も復帰すると考えられるが、一度、暴走したコアは再度、暴走するおそれがあるため、別のコア2〜nがマスターを引き受けることが好ましい。   When the core 1 runs out of control, the other cores 2 to n detect that the core 1 has gone out of control with reference to the core ID disclosure register 39. The runaway core 1 is powered off or reset. When the core 1 is reset, it is considered that the core 1 also returns. However, since the core that has once runaway may run away again, it is preferable that another core 2 to n takes over the master.

そこで、コア1の暴走を検知した他のコア2〜nは、レジスタに記憶しているマスターのコア1が暴走したので、他のコアのIDを参照して、次のマスターのコアを決定する。この場合、最も小さいIDを持つコア2がマスターを引き受ける。   Therefore, the other cores 2 to n that have detected the runaway of the core 1 run away from the master core 1 stored in the register, and therefore determine the next master core with reference to the ID of the other core. . In this case, the core 2 having the smallest ID takes over the master.

コア2はマスターのコアIDを記憶するレジスタに自己のIDを記憶すると共に、他のコア3〜nにID=2を通知する。各コ3〜nアは、マスターのコアのコアIDを記憶するレジスタにコア2のID=2を記憶する。   The core 2 stores its own ID in a register that stores the core ID of the master, and notifies the other cores 3 to n of ID = 2. Each core 3-n stores the ID 2 of the core 2 in a register that stores the core ID of the master core.

このように、各コア1〜nが暴走したコアを特定できるので、暴走したコアがマスターであれば、他のコアが自律的にスレーブからマスターに切り替わることができる。   In this way, since the cores in which the cores 1 to n have runaway can be identified, if the runaway core is the master, other cores can autonomously switch from the slave to the master.

なお、マスターになったコア2はマスターに必要なタスクを実行する。例えば、必要に応じてマイコン自体をリセットする処理、コアを切り離したり、起動させる処理、クロック周波数を設定する処理などを行うことができる。   The core 2 that has become the master executes tasks necessary for the master. For example, a process of resetting the microcomputer itself, a process of disconnecting or starting the core, a process of setting a clock frequency, and the like can be performed as necessary.

以上説明したように、本実施例のマイコン100は、コア毎に「カウンタ値×ID」を求め合計し、2回の減算を行うだけで、暴走したコアを特定することができる。アイドルタスクはカウントアップするだけか、カウントアップ後に整数の乗算を行うだけでよいのでソフト的な負荷が増大することもほとんどない。   As described above, the microcomputer 100 according to the present embodiment can obtain the “counter value × ID” for each core, add them up, and specify the runaway core only by performing subtraction twice. Since the idle task only needs to be counted up or multiplied by an integer after counting up, the software load is hardly increased.

実施例1では、コア1〜nがソフト的に少なくともカウンタ値をカウントアップしたが、本実施例ではカウンタ値のカウントアップをカウンタ履歴部17が行うマイコン100について説明する。   In the first embodiment, the cores 1 to n count up at least the counter value in software, but in this embodiment, the microcomputer 100 in which the counter history unit 17 counts up the counter value will be described.

〔カウンタ回路1〜nが同じだけカウントアップするカウンタ履歴部〕
図10は、カウンタ履歴部17の構成例の一例を示す図である。実施例1ではアイドルタスクがカウンタ値をカウントアップしたが、本実施例ではカウンタ履歴部17がカウントアップを行う。このため、図10のカウンタ履歴部17はカウンタ回路42(以下、区別する場合、カウンタ回路1〜nという)を有する。
[Counter history section where counter circuits 1 to n count up by the same amount]
FIG. 10 is a diagram illustrating an example of a configuration example of the counter history unit 17. In the first embodiment, the idle task counts up the counter value, but in the present embodiment, the counter history unit 17 counts up. For this reason, the counter history unit 17 in FIG. 10 includes a counter circuit 42 (hereinafter, when distinguished, the counter circuits 1 to n).

コア1〜nのアイドルタスクは、タイマによる周期的な割込みを利用して、定期的にカウンタ履歴部17に通知する。カウンタ履歴部17は通知元のコア1〜nを判別して、コア1〜nに対応したカウンタ回路1〜nにカウンタ値をカウントアップさせる。各カウンタ回路1〜nはそれぞれ同じだけ(例えば、1つずつ)カウンタ値をカウントアップする。コア1〜nのIDは、定期的な通知に含ませておく。したがって、アイドルタスクは、コアのIDの通知という簡単な処理を行うだけでよい。   The idle tasks of the cores 1 to n periodically notify the counter history unit 17 using a periodic interrupt by a timer. The counter history unit 17 discriminates the notification source cores 1 to n and causes the counter circuits 1 to n corresponding to the cores 1 to n to count up the counter value. Each of the counter circuits 1 to n counts up the counter value by the same amount (for example, one by one). The IDs of the cores 1 to n are included in the periodic notification. Therefore, the idle task only needs to perform a simple process of notifying the core ID.

乗算器1〜nには、カウンタ回路1〜nから送出されたカウンタ値、及び、コア1〜nのID1〜nが供給される。乗算器1〜nは、各コアを識別するための処理として、コア毎にカウンタ値とコアのIDの乗算を行い、それぞれを加算器32に供給する。以降の処理は実施例1と同様であり、加算器32は乗算器1〜nから取得した「カウンタ値×ID」の合計値を算出する。減算器33は最も新しい合計値と前回の合計値の差である第1差を算出し、第1差記憶部37に記憶させる。減算器34は最も新しい第1差と前回の第1差の差である第2差を算出し、第2差記憶部38に記憶させる。   The multipliers 1 to n are supplied with the counter values sent from the counter circuits 1 to n and the IDs 1 to n of the cores 1 to n. As a process for identifying each core, the multipliers 1 to n multiply the counter value and the core ID for each core, and supply each to the adder 32. The subsequent processing is the same as in the first embodiment, and the adder 32 calculates the total value of “counter value × ID” acquired from the multipliers 1 to n. The subtractor 33 calculates a first difference that is the difference between the newest total value and the previous total value, and stores the first difference in the first difference storage unit 37. The subtractor 34 calculates a second difference, which is the difference between the newest first difference and the previous first difference, and stores it in the second difference storage unit 38.

コアが暴走した場合、該コアが実行するアイドルタスクはカウンタ履歴部17にコアのIDを通知できないので、該コアに対応したカウンタ回路40はカウントアップしない。すなわち、実施例1で暴走したコアがカウントアップしない場合と同様の状況が生じる。このため第2差には、コアが暴走したコアのIDが表れ、暴走していない他のコアはコアID公開用レジスタ39により暴走したコアを特定することができる。   When the core runs away, the idle task executed by the core cannot notify the counter history unit 17 of the core ID, and the counter circuit 40 corresponding to the core does not count up. That is, the same situation as the case where the runaway core in Example 1 does not count up occurs. For this reason, the ID of the core that has runaway appears in the second difference, and other cores that have not runaway can identify the core that has runaway by the core ID disclosure register 39.

したがって、カウンタ履歴部17にコア1〜nに対応したカウンタ回路1〜nを配置することで、アイドルタスクは、従来のウォッチドッグタイマのリセットと同様の簡易な処理を行うだけよくなり、ソフトウェアのコスト増を抑制できる。   Therefore, by disposing the counter circuits 1 to n corresponding to the cores 1 to n in the counter history unit 17, the idle task only needs to perform a simple process similar to the reset of the conventional watchdog timer, Cost increase can be suppressed.

〔カウンタ回路1〜nがそれぞれ異なる値をインクリメントするカウンタ履歴部〕
また、同様の構成において、乗算器31を省略することもできる。
図11はカウンタ履歴部17の構成例の一例を示す図である。図11では、各コアを識別するための処理を、カウンタ回路1〜nが行う。具体的には、カウンタ回路1〜nは、それぞれが互いに異なる値をカウントアップする。
[Counter history section in which counter circuits 1 to n increment different values]
Further, in the same configuration, the multiplier 31 can be omitted.
FIG. 11 is a diagram illustrating an example of a configuration example of the counter history unit 17. In FIG. 11, the counter circuits 1 to n perform processing for identifying each core. Specifically, the counter circuits 1 to n count up different values from each other.

コア1〜nのアイドルタスクは、タイマによる周期的な割込みを利用して、定期的にカウンタ履歴部17に通知する。カウンタ履歴部17は通知元のコアを判別して、コアに対応したカウンタ回路にカウンタ値をカウントアップさせる。   The idle tasks of the cores 1 to n periodically notify the counter history unit 17 using a periodic interrupt by a timer. The counter history unit 17 discriminates the notification source core and causes the counter circuit corresponding to the core to count up the counter value.

各カウンタ回路1〜nはそれぞれ、異なる値だけカウンタ値をカウントアップする。例えば、カウンタ回路1は“1”ずつカウントアップし、カウンタ回路2は“2”ずつカウントアップし、カウンタ回路nは“n”ずつカウントアップする。このようなカウントアップにより、「カウンタ値×ID」と同様、各コアを識別するための処理を実現できる。   Each of the counter circuits 1 to n counts up the counter value by a different value. For example, the counter circuit 1 counts up by “1”, the counter circuit 2 counts up by “2”, and the counter circuit n counts up by “n”. By such count-up, a process for identifying each core can be realized as in “counter value × ID”.

加算器32には、カウンタ回路1〜nから送出されたカウンタ値が供給される。加算器32は、カウンタ回路1〜nのカウンタ値を合計して、合計値を合計値記憶部36に記憶させる。   The counter value sent from the counter circuits 1 to n is supplied to the adder 32. The adder 32 adds up the counter values of the counter circuits 1 to n and stores the total value in the total value storage unit 36.

以降の処理は実施例1と同様であり、減算器33は最も新しい合計値と前回の合計値の差である第1差を算出し、第1差記憶部37に記憶させる。減算器34は最も新しい第1差と前回の第1差の差である第2差を算出し、第2差記憶部38に記憶させる。   The subsequent processing is the same as in the first embodiment, and the subtractor 33 calculates a first difference that is the difference between the newest total value and the previous total value, and stores the first difference in the first difference storage unit 37. The subtractor 34 calculates a second difference, which is the difference between the newest first difference and the previous first difference, and stores it in the second difference storage unit 38.

コアが暴走した場合、該コアに対応したカウンタ回路はカウントアップしない。このため第2差には、暴走したコアに対応するカウンタ回路42のカウントアップ量が表れる。カウントアップ量はコア毎に固定(一意)なので、暴走していない他のコアは暴走したコアを特定することができる。   When the core runs away, the counter circuit corresponding to the core does not count up. Therefore, the second difference shows the count-up amount of the counter circuit 42 corresponding to the runaway core. Since the count-up amount is fixed (unique) for each core, other cores that have not runaway can identify the runaway core.

したがって、アイドルタスクがカウントアップしなくても、カウンタ履歴部17がカウンタ回路42を有することで、暴走したコアを特定することができる。   Accordingly, even if the idle task does not count up, the counter history unit 17 having the counter circuit 42 can identify the runaway core.

11 プロセッサ
17 カウンタ履歴部
30 プログラム
31 乗算器
32 加算器
33、34 減算器
35 比較器
36 合計値記憶部
37 第1差記憶部
38 第2差記憶部
39 コアID公開用レジスタ
40 コアIDレジスタ
41 タイマ
42 カウンタ回路
100 マイコン
11 processor 17 counter history unit 30 program 31 multiplier 32 adder 33, 34 subtractor 35 comparator 36 total value storage unit 37 first difference storage unit 38 second difference storage unit 39 core ID disclosure register 40 core ID register 41 Timer 42 Counter circuit 100 Microcomputer

Claims (8)

複数のコアから共通の周期で通知を受け付けるコア監視装置であって、
コアから通知を受け付けた際、各コアに固有のコア識別数値をコア毎に生成するコア識別数値生成手段と、
複数のコアの前記コア識別数値を合計した合計値を算出する合計値算出手段と、
最後に算出された合計値を記憶する合計値記憶手段と、
前記合計値算出手段が算出した合計値と、前記合計値記憶手段に記憶された合計値との差である第一の差を算出する第一の差算出手段と、
最後に算出された第一の差を記憶する第一の差記憶手段と、
前記第一の差算出手段が算出した第一の差と、前記第一の差記憶手段に記憶された第一の差との差である第二の差を算出する第二の差算出手段と、
を有するコア監視装置。
A core monitoring device that receives notifications from a plurality of cores in a common cycle,
When receiving a notification from the core, core identification value generation means for generating a core identification value unique to each core for each core;
A total value calculating means for calculating a total value obtained by totaling the core identification values of a plurality of cores;
Total value storage means for storing the finally calculated total value;
First difference calculating means for calculating a first difference which is a difference between the total value calculated by the total value calculating means and the total value stored in the total value storing means;
First difference storage means for storing the first difference calculated last;
A second difference calculating means for calculating a second difference which is a difference between the first difference calculated by the first difference calculating means and the first difference stored in the first difference storing means; ,
A core monitoring device.
前記コア識別数値生成手段は、コア識別情報と共に、コアが周期的にカウントアップしたカウンタ値を取得し、コア識別情報及びカウンタ値を用いて前記コア識別数値を生成する、ことを特徴とする請求項1記載のコア監視装置。   The core identification numerical value generation means acquires a counter value that is periodically counted up by the core together with core identification information, and generates the core identification numerical value using the core identification information and the counter value. Item 2. The core monitoring apparatus according to Item 1. 前記コア識別数値生成手段は、各コアが周期的にカウントアップしたカウンタ値とコア識別情報を用いて生成した前記コア識別数値を取得する、ことを特徴とする請求項1記載のコア監視装置。   The core monitoring apparatus according to claim 1, wherein the core identification numerical value generation unit acquires the core identification numerical value generated by using a counter value counted by each core periodically and core identification information. 前記コア識別数値生成手段は、コア毎に周期的に通知されるコア識別情報の通知回数をコア毎にカウントするカウント回路を有し、
カウント回路のカウンタ値とコア識別情報からコア毎の前記コア識別数値を生成する、
ことを特徴とする請求項1記載のコア監視装置。
The core identification numerical value generating means has a count circuit that counts the number of notifications of core identification information periodically notified for each core,
The core identification value for each core is generated from the counter value of the count circuit and the core identification information.
The core monitoring apparatus according to claim 1.
前記コア識別数値は、カウンタ値とコア識別情報を乗算することで得られた乗算値である、ことを特徴とする請求項2〜4いずれか1記載のコア監視装置。   5. The core monitoring apparatus according to claim 2, wherein the core identification value is a multiplication value obtained by multiplying a counter value and core identification information. 前記コア識別数値生成手段は、コア識別情報の周期的な通知回数を、コア毎に異なる増大分に変換してカウントするカウント回路であり、該カウント回路のカウンタ値を各コアの前記コア識別数値とする、ことを特徴とする請求項1記載のコア監視装置。   The core identification value generation means is a count circuit that counts the number of periodic notifications of core identification information by converting it into different increments for each core, and counts the counter value of the count circuit for the core identification value of each core The core monitoring apparatus according to claim 1, wherein: 前記第二の差がゼロか否かを判定し、ゼロでない場合に、前記第二の差を公開する第二の差公開手段を有する、ことを特徴とする請求項1〜6いずれか1項記載のコア監視装置。   7. The apparatus according to claim 1, further comprising: a second difference disclosure unit that determines whether or not the second difference is zero and discloses the second difference when the second difference is not zero. The core monitoring device described. 請求項1〜7いずれか1項記載のコア監視装置と、
複数のコアを有するプロセッサと、
コアが実行するプログラムの記憶手段と、
を有する情報処理装置。
A core monitoring device according to any one of claims 1 to 7,
A processor having a plurality of cores;
Means for storing a program executed by the core;
An information processing apparatus.
JP2011225171A 2011-10-12 2011-10-12 Core monitoring device and information processor Pending JP2013084218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011225171A JP2013084218A (en) 2011-10-12 2011-10-12 Core monitoring device and information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011225171A JP2013084218A (en) 2011-10-12 2011-10-12 Core monitoring device and information processor

Publications (1)

Publication Number Publication Date
JP2013084218A true JP2013084218A (en) 2013-05-09

Family

ID=48529327

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011225171A Pending JP2013084218A (en) 2011-10-12 2011-10-12 Core monitoring device and information processor

Country Status (1)

Country Link
JP (1) JP2013084218A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015109071A (en) * 2013-10-25 2015-06-11 トヨタ自動車株式会社 Control device
JP2018092488A (en) * 2016-12-06 2018-06-14 株式会社リコー Electronic deice, image forming apparatus, control method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015109071A (en) * 2013-10-25 2015-06-11 トヨタ自動車株式会社 Control device
JP2018092488A (en) * 2016-12-06 2018-06-14 株式会社リコー Electronic deice, image forming apparatus, control method, and program

Similar Documents

Publication Publication Date Title
JP5244981B2 (en) Microcomputer and operation method thereof
JP5601127B2 (en) Control device
JP2011022934A (en) Electronic control unit and method for detecting failure
EP3935503A1 (en) Capacity management in a cloud computing system using virtual machine series modeling
JP6242557B1 (en) Control device and control program
US20100281485A1 (en) Method For Changing Over A System Having Multiple Execution Units
JP2013084218A (en) Core monitoring device and information processor
JP2011002993A (en) Watchdog timer monitoring device, and watchdog timer monitoring method
JP5652198B2 (en) Electronic control device, start control method
JP2013152636A (en) Information processing device and task scheduling method
JP2013143093A (en) Information processing apparatus and information processing system
JP6049961B1 (en) CPU monitoring device
JP2016184315A (en) Electronic controller
JP2013061783A (en) Multi-core processor
CN112631872A (en) Exception handling method and device of multi-core system
WO2018003560A1 (en) Electronic control device
JP5299681B2 (en) Program inspection method
JPWO2018229968A1 (en) Controller system
JP2020173644A (en) Electronic controller
JP7278205B2 (en) Computing device and method for monitoring computing device
JP2019020869A (en) Vehicle control device
JP7238574B2 (en) electronic controller
JP2012196071A (en) Power converter
JP4231465B2 (en) Embedded control device
JP2020181569A (en) Electronic control device