JP2012133458A - Microcomputer and resource allocation method - Google Patents

Microcomputer and resource allocation method Download PDF

Info

Publication number
JP2012133458A
JP2012133458A JP2010283151A JP2010283151A JP2012133458A JP 2012133458 A JP2012133458 A JP 2012133458A JP 2010283151 A JP2010283151 A JP 2010283151A JP 2010283151 A JP2010283151 A JP 2010283151A JP 2012133458 A JP2012133458 A JP 2012133458A
Authority
JP
Japan
Prior art keywords
core
program
abnormality
local
priority
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
JP2010283151A
Other languages
Japanese (ja)
Inventor
Kazumi Yamada
一美 山田
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 JP2010283151A priority Critical patent/JP2012133458A/en
Publication of JP2012133458A publication Critical patent/JP2012133458A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Hardware Redundancy (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a microcomputer with high reliability capable of efficiently using resources.SOLUTION: A microprocessor 100 in which a local memory 15 and a core 13 are allocated in a pair and which has two or more CPUs 11 whose cores use the paired local memory as a working memory comprises; malfunction detection means 41 detecting malfunction of the core or the local memory; a priority table in which priority of each program 31 is registered; and resource allocation changing means 43 changing combination of the core and the working memory when a malfunction has been detected in the core or the local memory, so that the core can execute a program with high priority first with the paired local memory of the core as the working memory.

Description

本発明は、コアやRAMの異常を検出可能なマイコンに関し、特に、プログラムをコアやマイコンに動的に割り当てるマイコン等に関する。   The present invention relates to a microcomputer capable of detecting an abnormality in a core or a RAM, and more particularly to a microcomputer or the like that dynamically assigns a program to a core or a microcomputer.

車載装置の電子化が進み、車載装置を制御するための多くの電子制御装置が車両に搭載されるようになった。電子制御装置にはマイコンが搭載されマイコンには1つ以上のCPUが搭載されるが、車載装置を制御するマイコンはその性質上、高い信頼性が要求される。   With the advance of computerization of in-vehicle devices, many electronic control devices for controlling the in-vehicle devices have been mounted on vehicles. A microcomputer is mounted on the electronic control device, and one or more CPUs are mounted on the microcomputer. However, a microcomputer that controls the in-vehicle device is required to have high reliability due to its nature.

また、近年CPUのマルチコア化やマルチCPU化が進んでおり、マイコンが複数のコアやCPUを有することを利用してマイコンの信頼性を向上させる技術が考案されている(例えば、特許文献1参照。)。特許文献1には、コアが故障した場合、プロセッサユニット内に代替実行可能なプロセッサコアが存在しなければ、最も優先度の低いプロセッサユニット内のプロセッサコアにアプリケーションを代替実行させるマルチプロセッサシステムが開示されている。このように、コアに故障が生じても、他の正常なコアが代替することで、マイコン全体の信頼性を向上させることができる。   In recent years, CPUs have become multi-core or multi-CPU, and a technique for improving the reliability of a microcomputer by utilizing the fact that the microcomputer has a plurality of cores and CPUs has been devised (for example, see Patent Document 1). .) Patent Document 1 discloses a multiprocessor system in which when a core fails, if there is no processor core that can be replaced in the processor unit, the processor core in the processor unit with the lowest priority executes the application instead. Has been. As described above, even when a failure occurs in the core, the reliability of the entire microcomputer can be improved by substituting another normal core.

特開2009−069963号公報JP 2009-069963 A

ところで、コアやCPUがプログラムを実行する場合は、RAMなどの作業メモリが必要になるため、故障する可能性はコアやCPUだけでなくRAMにもある。しかし、特許文献1に記載されたマルチプロセッサシステムはCPUとRAMの故障の切り分けについて考慮されていないという問題がある。例えば、コアやCPUに故障が生じたがRAMに故障が生じていない場合、RAMを有効に活用することで高い信頼性を維持したままリソースを有効に活用できる。この逆に、RAMに故障が生じたがコアやCPUに故障が生じていない場合も同様である。   By the way, when a core or CPU executes a program, a working memory such as a RAM is required. Therefore, there is a possibility of failure not only in the core and CPU but also in the RAM. However, the multiprocessor system described in Patent Document 1 has a problem that no consideration is given to the failure isolation between the CPU and the RAM. For example, when a failure has occurred in the core or CPU but no failure has occurred in the RAM, it is possible to effectively utilize the resources while maintaining high reliability by effectively utilizing the RAM. Conversely, the same applies to the case where a failure has occurred in the RAM but no failure has occurred in the core or CPU.

本発明は、上記課題に鑑み、リソースを有効に活用できる信頼性の高いマイコンを提供することを目的とする。   In view of the above problems, an object of the present invention is to provide a highly reliable microcomputer that can effectively use resources.

本発明は、上記課題に鑑み、ローカルメモリとコアが対に配置され、コアが対のローカルメモリを作業メモリとするCPUを2つ以上有するマイコンであって、コア又はローカルメモリの異常を検出する異常検出手段と、各プログラムの優先度が登録された優先度テーブルと、 コア又はローカルメモリの異常が検出された場合、優先度の高いプログラムほど優先的に、コアが該コアと対のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更するリソース割り当て変更手段と、を有するマイコンを提供する。   In view of the above problems, the present invention is a microcomputer in which a local memory and a core are arranged in pairs, and the core has two or more CPUs that use the paired local memory as a working memory, and detects an abnormality in the core or the local memory. Anomaly detection means, a priority table in which the priority of each program is registered, and when an abnormality in a core or local memory is detected, a program with a higher priority is given priority to the local memory paired with the core. A microcomputer having resource allocation changing means for changing the combination of the core and the working memory so as to execute as a working memory is provided.

リソースを有効に活用できる信頼性の高いマイコンを提供することができる。   A highly reliable microcomputer that can effectively use resources can be provided.

ローカルRAMの異常が検出された場合のコアとローカルRAMの組合せをプログラムの優先度に応じて変更する過程を説明する図の一例である。FIG. 10 is an example of a diagram illustrating a process of changing a combination of a core and a local RAM according to a priority of a program when an abnormality of the local RAM is detected. コアの異常が検出された場合のコアとローカルRAMの組合せをプログラムの優先度に応じて変更する過程を説明する図の一例であるIt is an example of the figure explaining the process of changing the combination of a core and local RAM according to the priority of a program when abnormality of a core is detected マイコンのハードウェア構成図の一例である。It is an example of the hardware block diagram of a microcomputer. プログラム1〜3の優先度が登録された優先度テーブルの一例である。It is an example of a priority table in which priorities of programs 1 to 3 are registered. コア1〜3の機能ブロック図の一例である。It is an example of the functional block diagram of the cores 1-3. 異常の検出結果を模式的に示す図の一例である。It is an example of the figure which shows the detection result of abnormality typically. 各コアに共通の割り当て制御の手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the procedure of the allocation control common to each core. マルチプロセッサ型のマイコンのハードウェア構成図の一例である。It is an example of the hardware block diagram of a multiprocessor type microcomputer. マルチコア型又はマルチプロセッサ型のマイコンにおいて、コア1、2のフェールセーフ処理を1つのコアが集中的に制御する場合の機能ブロック図の一例である。FIG. 3 is an example of a functional block diagram when a single core centrally controls fail-safe processing of cores 1 and 2 in a multi-core type or multi-processor type microcomputer. コア3がコア1、2を監視する手順のシーケンス図の一例である。It is an example of a sequence diagram of a procedure in which the core 3 monitors the cores 1 and 2.

以下、本発明を実施するための形態について図面を参照しながら説明する。
本実施形態では、コアに少なくとも1つのローカルRAMが対に配置されたCPUにおいて、何らかの異常が検出された場合に、コアがワークメモリとするローカルRAMを、プログラムの優先度に応じて柔軟に組み替えるマイコンについて説明する。
Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
In this embodiment, when any abnormality is detected in a CPU in which at least one local RAM is arranged in a pair in the core, the local RAM that the core uses as a work memory is flexibly rearranged according to the priority of the program. The microcomputer will be described.

図1は、ローカルRAMの異常が検出された場合のコアとローカルRAMの組合せをプログラムの優先度に応じて変更する過程を説明する図の一例である。3つのコア1〜3がそれぞれローカルRAM1〜3をワークメモリにしてプログラム1〜3を実行している。また、予め優先度テーブルにプログラム1〜3の優先度が定義されている。   FIG. 1 is an example of a diagram illustrating a process of changing a combination of a core and a local RAM according to the priority of a program when an abnormality of the local RAM is detected. Three cores 1 to 3 execute programs 1 to 3 using local RAMs 1 to 3 as work memories, respectively. The priorities of programs 1 to 3 are defined in advance in the priority table.

例えばローカルRAM1の異常が検出された場合、コア1は優先度テーブルを参照して、コア2又はコア3がプログラム1よりも優先度の低いプログラムを実行しているか否かを判定する。
(1)コア2がプログラム1よりも優先度の低いプログラム2を実行している場合、コア1はローカルRAM2をワークメモリとしたまま優先度の低いプログラム2を自機に割り当てる。
For example, when an abnormality in the local RAM 1 is detected, the core 1 refers to the priority table and determines whether the core 2 or the core 3 is executing a program having a lower priority than the program 1.
(1) When the core 2 is executing the program 2 having a lower priority than the program 1, the core 1 assigns the program 2 having a lower priority to the own machine while keeping the local RAM 2 as a work memory.

また、コア2はローカルRAM2をワークメモリとして、優先度の高いプログラム1を自機に割り当てる。   The core 2 uses the local RAM 2 as a work memory, and assigns a high priority program 1 to the own machine.

プログラム2はプログラム1よりも優先度が低いので、コア1がコア2のローカルRAM2をワークメモリにプログラム2を実行することにより処理速度が低下しても、許容しやすい。また、プログラム1はプログラム2よりも優先度が高いが、コア2が対のローカルRAM2をワークメモリにしてプログラム1を実行するので、処理速度が低下することを防止できる。
(2)コア2又はコア3がプログラム1よりも優先度の低いプログラムを実行していない場合、コア1はローカルRAM2をワークメモリとしてプログラム1を実行する。
Since the program 2 has a lower priority than the program 1, even if the processing speed decreases when the core 1 executes the program 2 using the local RAM 2 of the core 2 as a work memory, it is easily tolerated. Although the program 1 has a higher priority than the program 2, the core 2 executes the program 1 using the paired local RAM 2 as a work memory, so that the processing speed can be prevented from decreasing.
(2) When the core 2 or the core 3 is not executing a program having a lower priority than the program 1, the core 1 executes the program 1 using the local RAM 2 as a work memory.

この場合、プログラム1が最も優先度が低いので、コア1がコア2のローカルRAM2をワークメモリにプログラム1を実行することにより処理速度が低下しても、許容しやすい。   In this case, since the priority of the program 1 is the lowest, even if the processing speed is reduced by the core 1 executing the program 1 on the local RAM 2 of the core 2 as a work memory, it is easily tolerated.

図2は、コアの異常が検出された場合のコアとローカルRAMの組合せをプログラムの優先度に応じて変更する過程を説明する図の一例である。コア1の異常が検出された場合、例えばコア2は優先度テーブルを参照して、コア2又はコア3がプログラム1よりも優先度の低いプログラムを実行しているか否かを判定する。
(3)例えばコア2がプログラム1よりも優先度の低いプログラム2を実行している場合、コア2はローカルRAM1をワークメモリとして優先度の低いプログラム2を実行する。また、コア2はローカルRAM2をワークメモリとして優先度の高いプログラム1を実行する。
FIG. 2 is an example of a diagram illustrating a process of changing the combination of the core and the local RAM in accordance with the priority of the program when a core abnormality is detected. When an abnormality of the core 1 is detected, for example, the core 2 refers to the priority table and determines whether the core 2 or the core 3 is executing a program having a lower priority than the program 1.
(3) For example, when the core 2 is executing a program 2 having a lower priority than the program 1, the core 2 executes the program 2 having a lower priority using the local RAM 1 as a work memory. The core 2 executes the program 1 having a high priority with the local RAM 2 as a work memory.

プログラム2はプログラム1よりも優先度が低いので、コア2がコア1のローカルRAM1をワークメモリにプログラム2を実行することにより処理速度が低下しても、許容しやすい。また、プログラム1はプログラム2よりも優先度が高いが、コア2が対のローカルRAM2をワークメモリにしてプログラム1を実行するので、処理速度が低下することを防止できる。
(4)コア2又はコア3がプログラム1よりも優先度の低いプログラムを実行していない場合、コア2はローカルRAM1をワークメモリとしてプログラム1を実行する。
Since the program 2 has a lower priority than the program 1, the core 2 can easily tolerate even if the processing speed decreases by executing the program 2 on the local RAM 1 of the core 1 in the work memory. Although the program 1 has a higher priority than the program 2, the core 2 executes the program 1 using the paired local RAM 2 as a work memory, so that the processing speed can be prevented from decreasing.
(4) When the core 2 or the core 3 is not executing a program having a lower priority than the program 1, the core 2 executes the program 1 using the local RAM 1 as a work memory.

この場合、プログラム1が最も優先度が低いので、コア2がコア1のローカルRAM1をワークメモリにプログラム2を実行することにより処理速度が低下しても、許容しやすい。   In this case, since the program 1 has the lowest priority, the core 2 can easily tolerate even if the processing speed is lowered by executing the program 2 on the local RAM 1 of the core 1 as a work memory.

このように、本実施形態のマイコンは、コア又はローカルRAMに異常が生じても、異常が生じていないリソースを活用してプログラムの実行を継続できる。その際、マイコンは、プログラムの優先度を考慮して、コアが優先度の高いプログラムを優先的にコアと対のローカルRAMをワークメモリにして実行するようにコアとワークメモリの組み合わせを決定する。   As described above, even if an abnormality occurs in the core or the local RAM, the microcomputer according to the present embodiment can continue the execution of the program by using the resource in which no abnormality has occurred. At that time, the microcomputer determines the combination of the core and the work memory in consideration of the priority of the program so that the core preferentially executes the high priority program with the local RAM paired with the core as the work memory. .

異常がない、コアと対のローカルRAMの数よりもプログラムの数の方が多い場合、優先的に割り当てられないプログラムは、コアが対でないローカルRAMをワークメモリにして実行する。   When the number of programs is larger than the number of local RAMs paired with the core without any abnormality, a program that is not preferentially assigned is executed using the local RAM with no cores as a work memory.

よって、優先度の高いプログラムの実行速度の低下を防止しながら、優先度の低いプログラムの実行を継続することができる。   Therefore, it is possible to continue the execution of the low priority program while preventing a decrease in the execution speed of the high priority program.

〔構成〕
図3は、マイコン100のハードウェア構成図の一例を示す。マイコン100は、マルチレイヤバス28を介して接続されたプロセッサ21、DMAC22、SDRAM23、I/Oブリッジ25及びROM24を有する。プロセッサ21は、3つのCPU(以下、区別する場合CPU1〜3という)11を有するが、CPU11の数は2つ以上であれば4つ以上でもよい。各CPU1〜3は、コア間通信部12、リセット部14、コア13、及び、ローカルRAM15を有する。ローカルRAM15は1つのCPU11内に複数個存在してもよい。なお、各CPU1〜3の機能を区別するため、CPU内の各機能にCPU1〜3と同じ番号を付す。
〔Constitution〕
FIG. 3 shows an example of a hardware configuration diagram of the microcomputer 100. The microcomputer 100 includes a processor 21, a DMAC 22, an SDRAM 23, an I / O bridge 25, and a ROM 24 that are connected via a multilayer bus 28. The processor 21 includes three CPUs (hereinafter referred to as CPUs 1 to 3 when distinguished) 11. However, the number of the CPUs 11 may be four or more as long as it is two or more. Each of the CPUs 1 to 3 includes an inter-core communication unit 12, a reset unit 14, a core 13, and a local RAM 15. A plurality of local RAMs 15 may exist in one CPU 11. In addition, in order to distinguish the functions of the CPUs 1 to 3, the same numbers as the CPUs 1 to 3 are assigned to the functions in the CPU.

コア1〜3は、PC(プログラムカウンタ)、命令バッファ、IFU(Instruction Fetch Unit)、DEC(DECoder)、RF(Register Fetch)、REG(REGister)、SH(Shifter)、ALU、MUL及びFPU等の演算回路、汎用レジスタ、及び、ロード/ストアユニット等を有する。これらが1クロック毎に命令実行段階の各ステージを実行することでいわゆるパイプライン制御が実現されている。   The cores 1 to 3 are PC (program counter), instruction buffer, IFU (Instruction Fetch Unit), DEC (DECoder), RF (Register Fetch), REG (REGister), SH (Shifter), ALU, MUL, FPU, etc. An arithmetic circuit, a general-purpose register, a load / store unit, and the like are included. By executing each stage of the instruction execution stage every clock, so-called pipeline control is realized.

ローカルRAM1はコア1に専用のメモリ(一次キャッシュ)であり、ローカルRAM2はコア2に専用のメモリであり、ローカルRAM3はコア3に専用のメモリである。専用のメモリとは、コア1はローカルRAM1〜3を使用することができるが、ローカルRAM1に比べ、コア1がローカルRAM2,3をワークメモリとする際には制限があることをいう。例えば、コア2,3によるローカルRAM2、3の使用許可が必要であったり、コア2,3がローカルRAM2,3の容量を所定量以上使用している場合は使用できなかったり、コア2,3がローカルRAM2,3にアクセスしている場合は待機する必要があったりすることである。また、コア1がローカルRAM2,3にアクセスする際は、コア通信バス17又はマルチレイヤバス28を経由する必要があるので、バスの調停など物理的な距離や構成に起因して、コア1のローカルRAM2,3に対するアクセスの優先度は低くなる。これも制限の1つである。   The local RAM 1 is a memory (primary cache) dedicated to the core 1, the local RAM 2 is a memory dedicated to the core 2, and the local RAM 3 is a memory dedicated to the core 3. The dedicated memory means that the core 1 can use the local RAMs 1 to 3, but has a limitation when the core 1 uses the local RAMs 2 and 3 as work memories as compared to the local RAM 1. For example, it is necessary to permit use of the local RAMs 2 and 3 by the cores 2 and 3, or when the cores 2 and 3 use the capacity of the local RAMs 2 and 3 over a predetermined amount, the cores 2 and 3 cannot be used. May need to wait when accessing the local RAMs 2 and 3. Further, when the core 1 accesses the local RAMs 2 and 3, it is necessary to go through the core communication bus 17 or the multi-layer bus 28. Therefore, due to physical distance and configuration such as bus arbitration, the core 1 The priority of access to the local RAMs 2 and 3 is low. This is another limitation.

コア1〜3は、ROM24に記憶されたフェールセーフプログラム32及びOS33を実行する。プログラム31(以下、区別する場合プログラム1〜3という)は、OS33などによりコア1〜3に任意に割り当てられて、各コア1〜3が実行することが可能である。起動時の割り当ては決まっていてもいなくてもよいが、起動時、コア1〜3は専用のローカルRAM1〜3をワークメモリとする。以下では、コア1〜3と専用のローカルRAM1〜3との組み合わせを「専用組み合わせ」という。
コア間通信部1〜3は、コア通信バス17を介してコア1〜3が相互に通信することを可能にする。コア1〜3は、コア間通信部1〜3により、他のコアの異常の有無を監視したり、ローカルRAM1〜3にアクセスする。コア間通信部1〜3はローカルRAM1〜3を介してデータを相互に通信することができる。また、コア間通信部1〜3は、専用組み合わせでないコア1〜3からローカルRAM1〜3へのアクセス要求を遮断するスイッチや、専用組み合わせでないコア1〜3からアクセス可能なローカルRAM1〜3の領域を一部に制限するアクセス制限の機能を備える。なお、コア1〜3は、マルチレイヤバス28を経由して互いに通信することもできる。
The cores 1 to 3 execute the fail safe program 32 and the OS 33 stored in the ROM 24. The program 31 (hereinafter referred to as programs 1 to 3 when distinguished) is arbitrarily assigned to the cores 1 to 3 by the OS 33 or the like, and can be executed by the cores 1 to 3. Allocation at startup may or may not be determined, but at startup, the cores 1 to 3 use dedicated local RAMs 1 to 3 as work memories. Hereinafter, a combination of the cores 1 to 3 and the dedicated local RAMs 1 to 3 is referred to as a “dedicated combination”.
The inter-core communication units 1 to 3 allow the cores 1 to 3 to communicate with each other via the core communication bus 17. The cores 1 to 3 use the inter-core communication units 1 to 3 to monitor the presence / absence of other cores and access the local RAMs 1 to 3. The inter-core communication units 1 to 3 can communicate data with each other via the local RAMs 1 to 3. The inter-core communication units 1 to 3 are switches that block access requests from the non-dedicated combination cores 1 to 3 to the local RAMs 1 to 3 and the local RAMs 1 to 3 that are accessible from the non-dedicated combination cores 1 to 3. A function for restricting access is provided. The cores 1 to 3 can also communicate with each other via the multilayer bus 28.

リセット回路1〜3は、自コア又は他コアをリセットする回路である。自コアをリセットするのは例えばマイコン100の起動時にCPU1〜3をそれぞれ自コアが初期化してOS33等を起動するためである。他コアをリセットするのは、主に他コアを停止させるためである。リセット回路1はリセット回路2,3にリセット信号(HighアクティブでもLowアクティブでもよい)を継続的に出力することができる(結線は不図示)。リセット回路2,3についても同様である。リセット信号が継続的に出力されるとクロック信号が停止したままになるので、リセット信号が入力されたコア2,3は停止したままとなる。   The reset circuits 1 to 3 are circuits that reset the own core or another core. The reason for resetting the own core is that, for example, when the microcomputer 100 is started, the CPUs 1 to 3 are initialized and the OS 33 is started. The reason for resetting the other core is mainly to stop the other core. The reset circuit 1 can continuously output a reset signal (high active or low active) to the reset circuits 2 and 3 (connection is not shown). The same applies to the reset circuits 2 and 3. Since the clock signal remains stopped when the reset signal is continuously output, the cores 2 and 3 to which the reset signal is input remain stopped.

DMAC22は、マルチレイヤバス28に接続された各ブロックからのSDRAM23へのアクセス要求を調停すると共に、I/Oブリッジ25からSDRAM23へ又はSDRAM23からI/Oブリッジ25へ、コア1〜3を介在することなくデータを転送する。DMAC22は転送終了によりコア1〜3に適宜割込みをかけることできる。   The DMAC 22 arbitrates access requests to the SDRAM 23 from each block connected to the multi-layer bus 28, and interposes the cores 1 to 3 from the I / O bridge 25 to the SDRAM 23 or from the SDRAM 23 to the I / O bridge 25. Transfer data without The DMAC 22 can appropriately interrupt the cores 1 to 3 upon completion of the transfer.

SDRAM23は、コア1〜3にプログラム又はデータを提供するためのメモリ(二次キャッシュ)である。SDRAM23の少なくとも一部はコア1〜3により共有される。ROM24にはプログラム1〜3、フェールセーフプログラム32、及び、OS33が記憶されている。説明の都合上、プログラム1〜3は3つとしたがプログラムの数は4つ以上でもよい。この場合、複数のプログラム31が割り当てられるコア13が存在することになる。   The SDRAM 23 is a memory (secondary cache) for providing a program or data to the cores 1 to 3. At least a part of the SDRAM 23 is shared by the cores 1 to 3. The ROM 24 stores programs 1 to 3, a fail safe program 32, and an OS 33. For convenience of explanation, the number of programs 1 to 3 is three, but the number of programs may be four or more. In this case, there is a core 13 to which a plurality of programs 31 are assigned.

I/Oブリッジ25は、マルチレイヤバス28とI/Oバス27の間で相互に周波数や電圧値などを変換する。I/Oバス27には種々のI/O26が接続されている。I/O26はマイコン100と外部の機器を接続するインタフェースであり、各種のセンサ、アクチュエータ、CANコントローラ等が接続される。なお、このマイコン100は例えば車両のECU(electronic control unit)に適用される。   The I / O bridge 25 converts a frequency, a voltage value, and the like between the multilayer bus 28 and the I / O bus 27. Various I / Os 26 are connected to the I / O bus 27. The I / O 26 is an interface for connecting the microcomputer 100 and an external device, to which various sensors, actuators, CAN controllers, and the like are connected. The microcomputer 100 is applied to, for example, an ECU (electronic control unit) of a vehicle.

〔プログラムのコアへの割り当て〕
本実施形態のマイコン100は、プログラム1〜3の優先度を考慮してプログラム1〜3が実行されるコア1〜3とローカルRAM15の組合せを任意に変更するので、いわゆるSMP(Symmetric Multi‐processing)の実行態様といえる。または、あるプログラムだけ割り当てられるコアを固定にしておき、その他のプログラムをマイコン100がコア1〜3に動的に割り当てることもできる(BMP(Bound Multi‐processing))。
[Assignment of program to core]
The microcomputer 100 according to the present embodiment arbitrarily changes the combination of the cores 1 to 3 in which the programs 1 to 3 are executed and the local RAM 15 in consideration of the priorities of the programs 1 to 3, so that the so-called SMP (Symmetric Multi-processing) is performed. ). Alternatively, the core to which only a certain program is assigned can be fixed, and the other program can be dynamically assigned to the cores 1 to 3 by the microcomputer 100 (BMP (Bound Multi-processing)).

本実施形態のマイコン100は、OS33がコア1〜3とローカルRAM15の組合せを制御するものとするが、この機能はプログラム31が提供してもよい。OS33は、プログラム1〜3の優先度と状態(実行可能、実行中、実行待ち等)に応じてコア1〜3にプログラム1〜3を割り当てる。プログラム1〜3は、互いに独立して実行可能な場合も、相互に関連している場合もある。前者の場合、OS33は優先度にだけ基づいてコア1〜3にプログラム1〜3を割り当てればよい。   In the microcomputer 100 of this embodiment, the OS 33 controls the combination of the cores 1 to 3 and the local RAM 15, but this function may be provided by the program 31. The OS 33 assigns the programs 1 to 3 to the cores 1 to 3 according to the priorities and states (executable, executing, waiting for execution, etc.) of the programs 1 to 3. The programs 1 to 3 may be executed independently of each other or may be related to each other. In the former case, the OS 33 may assign the programs 1 to 3 to the cores 1 to 3 based only on the priority.

図4(a)は、プログラム1〜3の優先度が登録された優先度テーブルの一例を示す。優先度テーブルはROM24に記憶されており、コア1〜3が参照することができる。図では、プログラム1の優先度を「高」、プログラム2の優先度を「中」、プログラム1の優先度を「低」としたがあくまで一例である。   FIG. 4A shows an example of a priority table in which the priorities of programs 1 to 3 are registered. The priority table is stored in the ROM 24 and can be referred to by the cores 1 to 3. In the figure, the priority of program 1 is “high”, the priority of program 2 is “medium”, and the priority of program 1 is “low”.

後者の場合(相互に関連している場合)が生じるのは、例えばプログラム2がプログラム1の処理結果を利用する場合等である。このような場合、プログラム2はサービスコールをOS33に要求して、実行待ち状態となる。プログラム1は処理が完了すると同様にサービスコールをOS33に要求してプログラム2を実行可能状態にする。OS33は、このような状態遷移を監視して、優先度を考慮しながらコア1〜3にプログラム1〜3を割り当てていく。   The latter case (when they are related to each other) occurs, for example, when the program 2 uses the processing result of the program 1. In such a case, the program 2 requests a service call from the OS 33 and enters an execution waiting state. When the process is completed, the program 1 requests a service call from the OS 33 to make the program 2 executable. The OS 33 monitors such state transitions and assigns the programs 1 to 3 to the cores 1 to 3 while considering the priority.

図4(b)は、OS33が割り当てたコア1〜3とプログラム1〜3の関係の一例を示す。コアとプログラムの数が等しいので、プログラム1〜3に優先度の違いがあっても、各コア1〜3に1つのプログラム1〜3が割り当てられている。コア1〜3が実行しているプログラム1〜3の情報はコア間通信部1〜3を介して交換されるので、各コア1〜3は最新の割り当て状況を共有することができる。   FIG. 4B shows an example of the relationship between the cores 1 to 3 and the programs 1 to 3 assigned by the OS 33. Since the number of cores and programs is equal, even if the programs 1 to 3 have different priorities, one program 1 to 3 is assigned to each core 1 to 3. Since the information of the programs 1 to 3 executed by the cores 1 to 3 is exchanged via the inter-core communication units 1 to 3, the cores 1 to 3 can share the latest allocation status.

なお、一般的なSMPではいずれかのコアがOS33を実行して、OS33が複数のコアへのプログラムの割り当てを制御するが、こうするとOS33を実行するコア13に異常が生じた場合に、コア1〜3とワークメモリの組合せの変更が困難になる。そこで、本実施形態は、コア1〜3とワークメモリの組合せを変更する機能(後述する割り当て制御部)は各コア1〜3が有しているものとする。   In general SMP, one of the cores executes the OS 33, and the OS 33 controls the allocation of programs to a plurality of cores. However, when an abnormality occurs in the core 13 that executes the OS 33, the core It becomes difficult to change the combination of 1 to 3 and the work memory. Therefore, in the present embodiment, it is assumed that each of the cores 1 to 3 has a function of changing the combination of the cores 1 to 3 and the work memory (an allocation control unit described later).

具体的には、例えば、コア1〜3又はローカルRAM1〜3の異常を検出したコア13が、OS33又はOS33と同様の機能を使って、異常が検出されたコア1〜3又はローカルRAM1〜3で実行されていたプログラム1〜3を、その優先度に応じて、専用割り当て又は専用割り当てでない組み合わせのコア13とローカルRAM15に割り当てる。   Specifically, for example, the core 13 that has detected an abnormality in the cores 1 to 3 or the local RAMs 1 to 3 uses the same function as the OS 33 or the OS 33 to detect the abnormality in the cores 1 to 3 or the local RAMs 1 to 3. The programs 1 to 3 executed in (1) are allocated to the core 13 and the local RAM 15 in a dedicated allocation or a combination that is not dedicated allocation according to the priority.

〔機能ブロック図〕
図5は、コア1〜3の機能ブロック図の一例である。コア1〜3はそれぞれ、異常監視部41、停止部42、及び、割り当て制御部43を有する(各CPUの機能を区別するため、機能ブロックにCPUと同じ番号を付す。)。各機能ブロックは、コア1〜3がフェールセーフプログラム32及びOS33の少なくとも一方を実行することで実現される。
[Function block diagram]
FIG. 5 is an example of a functional block diagram of the cores 1 to 3. Each of the cores 1 to 3 includes an abnormality monitoring unit 41, a stopping unit 42, and an allocation control unit 43 (in order to distinguish the functions of the CPUs, the function blocks are given the same numbers as the CPUs). Each functional block is realized by the cores 1 to 3 executing at least one of the fail-safe program 32 and the OS 33.

<異常監視部>
異常監視部41は、コア13及びローカルRAM15の異常を監視する。監視形態はいくつか考えられるが、1つの異常監視部41はコア1〜3の全ての異常を監視する能力、及び、ローカルRAM1〜3の全ての異常を監視する能力を有するものとし、適宜、監視形態を変える。
<Abnormality monitoring unit>
The abnormality monitoring unit 41 monitors the abnormality of the core 13 and the local RAM 15. Several monitoring forms are possible, but one abnormality monitoring unit 41 has the ability to monitor all abnormalities of the cores 1 to 3 and the ability to monitor all abnormalities of the local RAMs 1 to 3, Change the monitoring mode.

(1)監視形態
A.コア1〜3及びRAM1〜3が正常な場合
・コアの監視
異常監視部1はコア2の異常を、異常監視部2はコア3の異常を、異常監視部3はコア1の異常を、それぞれ監視する。コア13に異常が生じると異常監視部41の監視結果の信頼性も低下するので、各異常監視部1〜3が隣のコア1〜3の異常を監視することで、異常のあるコア自身が自機の異常を監視することを回避している。
・ローカルRAMの監視
異常監視部1はローカルRAM1の異常を、異常監視部2はローカルRAM2の異常を、異常監視部3はローカルRAM3の異常を、それぞれ監視する。専用組み合わせのコア13とローカルRAM15はプログラムの実行速度が速いので、このように監視することで負荷を抑制しやすい。コアの監視のように隣のローカルRAMを監視してもよい。
(1) Monitoring form A. When the cores 1 to 3 and the RAMs 1 to 3 are normal: The core monitoring abnormality monitoring unit 1 detects abnormality of the core 2, the abnormality monitoring unit 2 indicates abnormality of the core 3, and the abnormality monitoring unit 3 indicates abnormality of the core 1. Monitor. When an abnormality occurs in the core 13, the reliability of the monitoring result of the abnormality monitoring unit 41 is also reduced. It avoids monitoring the abnormality of its own aircraft.
The monitoring abnormality monitoring unit 1 of the local RAM monitors the abnormality of the local RAM 1, the abnormality monitoring unit 2 monitors the abnormality of the local RAM 2, and the abnormality monitoring unit 3 monitors the abnormality of the local RAM 3. Since the dedicated combination of the core 13 and the local RAM 15 has a high program execution speed, the load can be easily suppressed by monitoring in this way. The adjacent local RAM may be monitored as in the case of monitoring the core.

B.いずれかのコアの異常が検出された場合
・コアの監視
例えば、コア1の異常が検出されたとして説明する。コア1に異常が生じることにより、異常監視部1はコア2の異常を監視できないが、異常監視部1を監視していた異常監視部3はもはやコア1の異常を監視する必要がない。そこで、異常監視部3はコア2の異常を監視する。異常監視部2はコア3の異常を監視したままである。このように、コア1の異常が検出されても、異常監視部1〜3が監視対象を切り替えることでコア2,3の監視を継続できる。
・ローカルRAMの監視
例えば、コア1の異常が検出されたとして説明する。コア1の異常が生じることにより、異常監視部1はローカルRAM1の異常を監視できない。このため、異常監視部3が、コア1と共にローカルRAM1の異常を監視する。すなわち、異常監視部2はローカルRAM2の異常を監視したままであり、異常監視部3はローカルRAM3とローカルRAM1の異常を監視する。このように、コア1の異常が検出されても、異常監視部1〜3が監視対象を増やすことでローカルRAM1〜3の監視を継続できる。
B. When an abnormality of any of the cores is detected: Monitoring of the core For example, it is assumed that an abnormality of the core 1 is detected. When the abnormality occurs in the core 1, the abnormality monitoring unit 1 cannot monitor the abnormality of the core 2, but the abnormality monitoring unit 3 that has been monitoring the abnormality monitoring unit 1 no longer needs to monitor the abnormality of the core 1. Therefore, the abnormality monitoring unit 3 monitors the abnormality of the core 2. The abnormality monitoring unit 2 continues to monitor the abnormality of the core 3. As described above, even if the abnormality of the core 1 is detected, the abnormality monitoring units 1 to 3 can continue to monitor the cores 2 and 3 by switching the monitoring target.
Monitoring the local RAM For example, assume that an abnormality of the core 1 is detected. When the abnormality of the core 1 occurs, the abnormality monitoring unit 1 cannot monitor the abnormality of the local RAM 1. For this reason, the abnormality monitoring unit 3 monitors the abnormality of the local RAM 1 together with the core 1. That is, the abnormality monitoring unit 2 keeps monitoring the abnormality of the local RAM 2, and the abnormality monitoring unit 3 monitors the abnormality of the local RAM 3 and the local RAM 1. Thus, even if the abnormality of the core 1 is detected, the abnormality monitoring units 1 to 3 can continue to monitor the local RAMs 1 to 3 by increasing the number of monitoring targets.

C.いずれかのローカルRAMの異常が検出された場合
・コアの監視
コア1〜3は正常なので、異常監視部1〜3によるコア1〜3の監視形態に変更はない。
・ローカルRAMの監視
例えば、ローカルRAM1の異常が検出されたとして説明する。すでに、ローカルRAM1の異常が検出されたので、異常監視部1はローカルRAM1の監視を終了する。したがって、引き続き、異常監視部2はローカルRAM2を監視し、異常監視部3はローカルRAM3を監視する。
C. When abnormality of any local RAM is detected: Since the core monitoring cores 1 to 3 are normal, the monitoring mode of the cores 1 to 3 by the abnormality monitoring units 1 to 3 is not changed.
Monitoring the local RAM For example, it is assumed that an abnormality in the local RAM 1 is detected. Since the abnormality of the local RAM 1 has already been detected, the abnormality monitoring unit 1 ends the monitoring of the local RAM 1. Therefore, the abnormality monitoring unit 2 continues to monitor the local RAM 2, and the abnormality monitoring unit 3 monitors the local RAM 3.

このように、コア1〜3の1つ又はローカルRAM1〜3の1つに異常が検出されても、異常監視部1〜3は異常の監視を継続できる。   Thus, even if an abnormality is detected in one of the cores 1 to 3 or one of the local RAMs 1 to 3, the abnormality monitoring units 1 to 3 can continue to monitor the abnormality.

(2)異常の監視方法
A.コアの異常
コアの異常を検出する方法としては、コア同士の処理結果を比較する方法が知られている。例えば、異常監視部1は、コア2に診断プログラムの実行を要求し、同じ診断プログラムをコア1で実行して処理結果を比較する。コア1〜3には、SH、ALU、MUL及びFPU等の演算器が実装されているので、コアを監視するためにはこれら全ての演算器の異常を監視することが好ましい。このため、診断プログラムには、各演算器のみを1回以上使用するいくつかの関数が記述されており、各演算器毎の関数の処理結果を別々に出力するようになっている。
(2) Abnormality monitoring method Core abnormality As a method of detecting a core abnormality, a method of comparing processing results between cores is known. For example, the abnormality monitoring unit 1 requests the core 2 to execute a diagnostic program, executes the same diagnostic program on the core 1, and compares the processing results. Since arithmetic units such as SH, ALU, MUL, and FPU are mounted on the cores 1 to 3, it is preferable to monitor the abnormality of all these arithmetic units in order to monitor the core. For this reason, in the diagnostic program, several functions that use each arithmetic unit only once or more are described, and the processing result of the function for each arithmetic unit is output separately.

異常監視部1は、コア2とコア1の演算器毎の処理結果を比較して、演算器毎に異常の有無を監視することができる。個別の演算器の異常が検出されれば、後の解析に有効な情報となる。本実施形態では、1つでも演算器に異常が検出されればコアに異常があると判定する。   The abnormality monitoring unit 1 can monitor the presence / absence of abnormality for each computing unit by comparing the processing results of the computing units of the core 2 and the core 1. If an abnormality of an individual computing unit is detected, it becomes information effective for later analysis. In this embodiment, it is determined that there is an abnormality in the core if an abnormality is detected in even one computing unit.

異常監視部1〜3は、コア1〜3に異常があると判定すると、コア間通信部1〜3を介して異常が検出されたコア13をコア1〜3を通知する(例えば、コア1にコア1の異常を通知する必要はない。)。これにより、各コア1〜3が異常状態を共有できる。   When the abnormality monitoring units 1 to 3 determine that the cores 1 to 3 are abnormal, the abnormality monitoring units 1 to 3 notify the cores 1 to 3 of the core 13 in which the abnormality is detected via the inter-core communication units 1 to 3 (for example, the core 1 There is no need to notify the core 1 of the abnormality.) Thereby, each core 1-3 can share an abnormal state.

なお、コア1〜3による診断プログラムの処理結果は、コアが正常であれば固定の値を取るので、異常監視部1は、コア2に診断プログラムの実行を要求し、その処理結果と予め記憶している診断プログラムの処理結果とを比較してもよい。コア1が診断プログラムを実行する必要がないので負荷を低減できる。   In addition, since the processing result of the diagnostic program by the cores 1-3 takes a fixed value if the core is normal, the abnormality monitoring unit 1 requests the core 2 to execute the diagnostic program, and stores the processing result in advance. You may compare with the processing result of the diagnostic program. Since the core 1 does not need to execute a diagnostic program, the load can be reduced.

異常を監視するタイミングは、例えば、監視対象のコア1〜3の負荷状態が比較的低い場合や、負荷状態が低くなくても定期的なタイミング等である。負荷状態を知らせるため、各コアは例えばコアの使用率が所定値以下になると、他のコアに負荷状態が低下したことを通知する。   The timing for monitoring the abnormality is, for example, a case where the load state of the cores 1 to 3 to be monitored is relatively low, or a periodic timing even if the load state is not low. In order to notify the load state, for example, when the usage rate of the core falls below a predetermined value, each core notifies the other cores that the load state has decreased.

B.ローカルRAMの異常
ローカルRAM1〜3の異常を検出する方法には種々の方法がある。例えば、“0”を書き込んで“1”のままのbitがあるか否か(又はその逆)、なんらかのデータを読み書きして読み書きの前後で一致するか否か、全領域に“1010…”のパターンのデータを書き込み読み出せるか否か、メモリ上のまとまった領域を別の領域に正しくコピーできるか否か、等の方法がある。異常監視部1〜3は、ローカルRAM1〜3に対しこのような診断を行い、異常の有無を判定する。
B. Abnormal local RAM
There are various methods for detecting an abnormality in the local RAMs 1 to 3. For example, whether or not there is a bit that remains “1” after writing “0” (or vice versa), whether or not there is a match before and after reading / writing some data, There are methods such as whether or not pattern data can be written and read, and whether or not a clustered area on a memory can be correctly copied to another area. The abnormality monitoring units 1 to 3 perform such a diagnosis on the local RAMs 1 to 3 and determine whether there is an abnormality.

異常監視部1〜3は、ローカルRAM1〜3の異常が検出された場合、初期化するなどの回復を試みて異常が解消されない場合はフェールセーフを行う。例えば、コア間通信部1〜3を構成する複数のチップの1つを分離可能であれば、異常が生じたチップを使用しないようにする。このような分離が困難であったあり、又は、チップの一部を分離可能でもローカルRAM1〜3の所定の割合以上が使用不可になるような場合、異常監視部1〜3はローカルRAM1〜3に異常があると判定する。   When an abnormality is detected in the local RAMs 1 to 3, the abnormality monitoring units 1 to 3 perform fail-safe when attempting to recover such as initialization and the abnormality is not resolved. For example, if one of the plurality of chips constituting the inter-core communication units 1 to 3 can be separated, the chip in which an abnormality has occurred is not used. When such separation is difficult, or when a part of the chip can be separated but a predetermined ratio or more of the local RAMs 1 to 3 cannot be used, the abnormality monitoring units 1 to 3 are connected to the local RAMs 1 to 3. Is determined to be abnormal.

異常監視部1〜3は、ローカルRAM1〜3に異常があると判定すると、コア間通信部1〜3を介して異常が検出されたローカルRAM1〜3をコア1〜3に通知する。これにより、各コア1〜3が異常状態を共有できる。   If the abnormality monitoring units 1 to 3 determine that the local RAMs 1 to 3 are abnormal, the abnormality monitoring units 1 to 3 notify the cores 1 to 3 of the local RAMs 1 to 3 in which the abnormality is detected via the inter-core communication units 1 to 3. Thereby, each core 1-3 can share an abnormal state.

図6(a)は、異常の検出結果を模式的に示す図の一例である。コア1〜3は、コア1〜3又はローカルRAM1〜3の異常の通知を受け付けると、現在の異常状態を更新して記憶する。したがって、各コア1〜3は、図6(a)のような異常状態を共有して、異常が検出されていないコアやローカルRAMを組合せて、プログラム1〜3を割り当てることができる。   FIG. 6A is an example of a diagram schematically illustrating the abnormality detection result. When the cores 1 to 3 receive notifications of abnormalities in the cores 1 to 3 or the local RAMs 1 to 3, the cores 1 to 3 update and store the current abnormal state. Therefore, each of the cores 1 to 3 can share the abnormal state as shown in FIG. 6A and assign the programs 1 to 3 by combining the core and the local RAM in which no abnormality is detected.

異常を監視するタイミングは、例えば、マイコン100の起動直後や、自コアの負荷状態が比較的低い場合などである。負荷状態は例えばコアの使用率に基づいて判定する。   The timing for monitoring the abnormality is, for example, immediately after activation of the microcomputer 100 or when the load state of the own core is relatively low. The load state is determined based on, for example, the usage rate of the core.

<停止部>
図5に戻り、停止部1〜3は異常が検出されたコア1〜3を停止する。停止部1〜3と、停止部1〜3が停止するコア1〜3の関係は、異常監視部1〜3が監視する対象のコア1〜3と同じである。すなわち、停止部1はコア2に異常が検出された場合コア2を停止させ、停止部2はコア3に異常が検出された場合コア3を停止させ、停止部3はコア1に異常が検出された場合コア1を停止させる。
<Stopping section>
Returning to FIG. 5, the stop units 1 to 3 stop the cores 1 to 3 in which the abnormality is detected. The relationship between the stopping units 1 to 3 and the cores 1 to 3 that the stopping units 1 to 3 stop is the same as the cores 1 to 3 that are monitored by the abnormality monitoring units 1 to 3. That is, the stop unit 1 stops the core 2 when an abnormality is detected in the core 2, the stop unit 2 stops the core 3 when an abnormality is detected in the core 3, and the stop unit 3 detects an abnormality in the core 1. If so, the core 1 is stopped.

異常監視部1〜3が監視しているコア1〜3は既知なので、自コアの異常監視部1〜3が監視しているコア1〜3に異常が検出されたことが図6(a)のような異常状態から明らかになると、停止部1〜3は異常が検出されたコアを停止する。停止するには上記のリセット回路1〜3を作動させ、停止対象のコア13にリセット信号を継続的に出力すればよい。   Since the cores 1 to 3 monitored by the abnormality monitoring units 1 to 3 are already known, an abnormality is detected in the cores 1 to 3 monitored by the abnormality monitoring units 1 to 3 of the own core. When it becomes clear from such an abnormal state, the stop units 1 to 3 stop the core in which the abnormality is detected. In order to stop, the reset circuits 1 to 3 described above are operated, and a reset signal may be continuously output to the core 13 to be stopped.

停止部1〜3はコア1〜3を停止させると、又は、コア1〜3を停止させる所定時間前に、コア間通信部1〜3を介して停止させたコア1〜3をコア1〜3に通知する(例えば、コア1にコア1の停止を通知する必要はない。)。所定時間前に通知することで、コアが停止する前に、他のコアが必要なデータをローカルRAM15から取得することができる。図6(b)は、停止状態のコアが登録された図の一例である。これにより、各コア1〜3が停止されたコアを共有できる。   The stop units 1 to 3 stop the cores 1 to 3 that have been stopped via the inter-core communication units 1 to 3 before the cores 1 to 3 are stopped or a predetermined time before the cores 1 to 3 are stopped. 3 (for example, there is no need to notify the core 1 of the stop of the core 1). By giving the notification before the predetermined time, the data required by the other cores can be acquired from the local RAM 15 before the cores are stopped. FIG. 6B is an example of a diagram in which a stopped core is registered. Thereby, each core 1-3 can share the stopped core.

<割り当て制御部>
図5に戻り、割り当て制御部1〜3は、コア1〜3やローカルRAM1〜3の異常状態に更新があると、コア1〜3とローカルRAM1〜3の組合せの制御を開始する。
<Allocation control unit>
Returning to FIG. 5, the assignment control units 1 to 3 start controlling the combination of the cores 1 to 3 and the local RAMs 1 to 3 when the abnormal state of the cores 1 to 3 and the local RAMs 1 to 3 is updated.

図7は、各コアに共通の割り当て制御の手順を示すフローチャート図の一例である。
異常監視部1〜3は、それぞれ個別にコア1〜3及びローカルRAM1〜3の異常を検出している(S10)。
FIG. 7 is an example of a flowchart showing a procedure of assignment control common to each core.
The abnormality monitoring units 1 to 3 individually detect abnormalities in the cores 1 to 3 and the local RAMs 1 to 3 (S10).

まず、コア1〜3のいずれかの異常が検出された場合(S20のYes)、割り当て制御部1〜3は、異常が検出されたコア1〜3が実行していたプログラム1〜3と、他のコア1〜3が実行しているプログラム1〜3の優先度を比較する(S30)。この判定を行うのは、異常が検出されたコア1〜3を監視していたコア1〜3の割り当て制御部43である。
・コア1の異常:割り当て制御部3は、プログラム1と、プログラム2,3の優先度を比較する。
・コア2の異常:割り当て制御部1は、プログラム2と、プログラム1,3の優先度を比較する。
・コア3の異常:割り当て制御部2は、プログラム3と、プログラム2,3の優先度を比較する。
First, when any abnormality of the cores 1 to 3 is detected (Yes in S20), the allocation control units 1 to 3 execute the programs 1 to 3 executed by the cores 1 to 3 in which the abnormality is detected, Priorities of programs 1 to 3 executed by other cores 1 to 3 are compared (S30). This determination is performed by the cores 1 to 3 that have been monitoring the cores 1 to 3 in which the abnormality is detected.
Core 1 abnormality: The allocation control unit 3 compares the priorities of the program 1 and the programs 2 and 3.
Core 2 abnormality: The allocation control unit 1 compares the priorities of the program 2 and the programs 1 and 3.
Core 3 abnormality: The allocation control unit 2 compares the priorities of the program 3 and the programs 2 and 3.

異常が検出されたコア1〜3が実行していたプログラム1〜3よりも、優先度の低いプログラム1〜3がない場合(S40のNo)、異常が検出されたコア1〜3が実行していたプログラム1〜3の優先度が最も低いことになるので、割り当て制御部1〜3は異常が検出されたコア1〜3が実行していたプログラム1〜3を自コアに割り当てる(S50)。ただし、ワークメモリは元のローカルRAM1〜3のままとする。
・コア1の異常:割り当て制御部3は、ワークメモリをローカルRAM1としたままプログラム1をコア3に割り当てる。
・コア2の異常:割り当て制御部1は、ワークメモリをローカルRAM2としたままプログラム2をコア1に割り当てる。
・コア3の異常:割り当て制御部3は、ワークメモリをローカルRAM3としたままプログラム3をコア2に割り当てる。
If there are no programs 1 to 3 having lower priority than the programs 1 to 3 executed by the cores 1 to 3 in which the abnormality is detected (No in S40), the cores 1 to 3 in which the abnormality is detected are executed. Since the priorities of the programs 1 to 3 that have been assigned are the lowest, the assignment controllers 1 to 3 assign the programs 1 to 3 executed by the cores 1 to 3 in which the abnormality is detected to the own core (S50). . However, the work memory remains the original local RAMs 1 to 3.
Core 1 abnormality: The allocation control unit 3 allocates the program 1 to the core 3 while keeping the work memory as the local RAM 1.
Core 2 abnormality: The allocation control unit 1 allocates the program 2 to the core 1 while keeping the work memory as the local RAM 2.
Core 3 abnormality: The assignment control unit 3 assigns the program 3 to the core 2 while keeping the work memory as the local RAM 3.

こうすることで、実行速度は低下しても優先度の低いプログラム1〜3を継続して実行することができる。   By doing so, even if the execution speed is lowered, the programs 1 to 3 having low priority can be continuously executed.

異常が検出されたコア1〜3が実行していたプログラム1〜3よりも、優先度の低いプログラムがある場合(S40のYes)、割り当て制御部1〜3は優先度のより高いプログラム1〜3が専用組み合わせのコアとローカルRAM1〜3で実行されるように、コア1〜3とコア1〜3がワークメモリとするローカルRAM1〜3との組合せを変更する(S60)。この場合、専用組み合わせでないコアとローカルRAMで実行されるのは、最も優先度の低いプログラム31である。
・コア1の異常
プログラムP1、P2>P3の場合
割り当て制御部3は、ローカルRAM3をワークメモリにしてプログラム1をコア3に割り当てる。割り当て制御部3は、プログラム3(低)をコア3に割り当てたまま、ワークメモリをローカルRAM1に変更する。
プログラムP1、P3>P2の場合
割り当て制御部3は、ローカルRAM2をワークメモリにしてプログラム1をコア2に割り当てる。割り当て制御部3は、プログラム2(低)をコア2に割り当てたまま、ワークメモリをローカルRAM1に変更する。
・コア2の異常
プログラムP2、P3>P1の場合
割り当て制御部1は、ローカルRAM1をワークメモリにしてプログラム2をコア1に割り当てる。割り当て制御部1は、プログラム1(低)をコア1に割り当てたまま、ワークメモリをローカルRAM2に変更する。
プログラムP2、P1>P3の場合
割り当て制御部1は、ローカルRAM3をワークメモリにしてプログラム2をコア3に割り当てる。割り当て制御部1は、プログラム3(低)をコア3に割り当てたまま、ワークメモリをローカルRAM2に変更する。
・コア3の異常
プログラムP1、P3>P2の場合
割り当て制御部2は、ローカルRAM2をワークメモリにしてプログラム3をコア2に割り当てる。割り当て制御部2は、プログラム2(低)をコア2に割り当てたまま、ワークメモリをローカルRAM3に変更する。
プログラムP2、P3>P1の場合
割り当て制御部2は、ローカルRAM1をワークメモリにしてプログラム3をコア1に割り当てる。割り当て制御部2は、プログラム1をコア1に割り当てたまま、ワークメモリをローカルRAM3に変更する。
When there is a program having a lower priority than the programs 1 to 3 executed by the cores 1 to 3 in which the abnormality is detected (Yes in S40), the allocation control units 1 to 3 have a higher priority than the programs 1 to 1. The combination of the cores 1 to 3 and the local RAMs 1 to 3 used by the cores 1 to 3 as work memories is changed so that 3 is executed by the dedicated combination of cores and the local RAMs 1 to 3 (S60). In this case, it is the program 31 with the lowest priority that is executed by the core and the local RAM that are not the dedicated combination.
In the case of the abnormal program P1, P2> P3 of the core 1, the allocation control unit 3 allocates the program 1 to the core 3 with the local RAM 3 as a work memory. The allocation control unit 3 changes the work memory to the local RAM 1 while allocating the program 3 (low) to the core 3.
In the case of programs P1, P3> P2, the allocation control unit 3 allocates the program 1 to the core 2 using the local RAM 2 as a work memory. The allocation control unit 3 changes the work memory to the local RAM 1 while allocating the program 2 (low) to the core 2.
When the abnormal program P2, P3> P1 of the core 2 The assignment control unit 1 assigns the program 2 to the core 1 using the local RAM 1 as a work memory. The allocation control unit 1 changes the work memory to the local RAM 2 while allocating the program 1 (low) to the core 1.
In the case of programs P2, P1> P3, the allocation control unit 1 allocates the program 2 to the core 3 with the local RAM 3 as a work memory. The allocation control unit 1 changes the work memory to the local RAM 2 while allocating the program 3 (low) to the core 3.
When the abnormal program P1, P3> P2 of the core 3 The allocation control unit 2 allocates the program 3 to the core 2 using the local RAM 2 as a work memory. The allocation control unit 2 changes the work memory to the local RAM 3 while allocating the program 2 (low) to the core 2.
In the case of programs P2, P3> P1, the allocation control unit 2 allocates the program 3 to the core 1 using the local RAM 1 as a work memory. The allocation control unit 2 changes the work memory to the local RAM 3 while allocating the program 1 to the core 1.

こうすることで、優先度のより高いプログラム1〜3は専用組み合わせで処理されるので実行速度の低下を防止でき、優先度のより低いプログラム1〜3も継続して実行することができる。   By doing so, since the programs 1 to 3 with higher priority are processed in a dedicated combination, a decrease in execution speed can be prevented, and the programs 1 to 3 with lower priority can be continuously executed.

なお、コア1〜3にプログラム1〜3を割り当てるとは、各コア1〜3の割り当て制御部1〜3の監視対象にプログラム1〜3を登録することであり、具体的には、プログラム1〜3のIDや先頭アドレスを他のコアの割り当て制御部1〜3に通知することである。割り当て制御部1〜3は、実行可能状態のプログラム1〜3を実行キューに登録して順番に実行する。   Note that assigning the programs 1 to 3 to the cores 1 to 3 means registering the programs 1 to 3 in the monitoring targets of the assignment control units 1 to 3 of the cores 1 to 3. Is to notify the allocation control units 1 to 3 of the other cores of IDs and head addresses of .about.3. The allocation control units 1 to 3 register the executable programs 1 to 3 in the execution queue and execute them sequentially.

また、コア1〜3に異常が検出された場合、コア1〜3が複数のプログラム1〜3を実行することになるので、割り当て制御部1〜3は優先度の高いプログラムの実行頻度を優先度の低いプログラムよりも大きくする。   Further, when an abnormality is detected in the cores 1 to 3, the cores 1 to 3 execute the plurality of programs 1 to 3, so the allocation control units 1 to 3 give priority to the execution frequency of the high priority program. Make it bigger than a lesser program.

また、コア1〜3がワークメモリとして使用するローカルRAM1〜3を変更するとは、変更前のローカルRAM1〜3から移動先のローカルRAMにコア1〜3のアクセス先を移動することである(プログラムやデータを移動する)。プログラム1〜3は、ベースレジスタの値からのオフセットを指定することでアクセスされる再配置可能なプログラムである。割り当て制御部1〜3はこれを利用して、プログラム1〜3が専用組み合わせのコア1〜3とローカルRAM1〜3で実行される場合は、ベースレジスタにローカルRAM1〜3におけるプログラム1〜3の先頭アドレスを設定する。   Further, changing the local RAMs 1 to 3 used by the cores 1 to 3 as work memory means that the access destinations of the cores 1 to 3 are moved from the local RAMs 1 to 3 before the change to the local RAMs to be moved (programs). Or move data). Programs 1 to 3 are relocatable programs that are accessed by specifying an offset from the value of the base register. The allocation control units 1 to 3 use this, and when the programs 1 to 3 are executed by the dedicated cores 1 to 3 and the local RAMs 1 to 3, the base registers store the programs 1 to 3 in the local RAMs 1 to 3. Set the start address.

コア1〜3が専用組み合わせでないローカルRAM1〜3をワークメモリとする場合、例えば、プログラムによってはコア間通信部1〜3やマルチレイヤバス28を介してローカルRAM1〜3にアクセスする必要がある。この場合、割り当て制御部1〜3は、ベースレジスタにローカルRAM1〜3を指定するアドレスとローカルRAM1〜3におけるプログラムの先頭アドレスを組み合わせて設定する。これにより、コア1〜3は、コア間通信部1〜3又はマルチレイヤバス28を介して他コアのローカルRAM1〜3にアクセスすることができる。   When the local RAMs 1 to 3 in which the cores 1 to 3 are not a dedicated combination are used as work memories, for example, depending on the program, it is necessary to access the local RAMs 1 to 3 via the inter-core communication units 1 to 3 and the multilayer bus 28. In this case, the assignment control units 1 to 3 set the base register in combination with the address for designating the local RAMs 1 to 3 and the program start address in the local RAMs 1 to 3. Thereby, the cores 1 to 3 can access the local RAMs 1 to 3 of the other cores via the inter-core communication units 1 to 3 or the multilayer bus 28.

次に、ローカルRAM1〜3のいずれかの異常が検出された場合(S120のYes)、割り当て制御部1〜3は、異常が検出されたローカルRAM1〜3をワークメモリにしていたプログラム1〜3と、他のプログラム1〜3の優先度を比較する(S130)。この判定を行うのは、ローカルRAM1〜3の異常を検出したコアの割り当て制御部43である。
・ローカルRAM1の異常
割り当て制御部1は、プログラム1と、プログラム2,3の優先度を比較
・ローカルRAM2の異常
割り当て制御部2は、プログラム2と、プログラム1,3の優先度を比較
・ローカルRAM3の異常
割り当て制御部3は、プログラム3と、プログラム1,2の優先度を比較
異常が検出されたローカルRAM1〜3をワークメモリにしていたプログラム1〜3よりも優先度が低いプログラム1〜3がない場合(S140のNo)、異常が検出されたローカルRAM1〜3をワークメモリとするプログラム1〜3の優先度が最も低いことになるので、割り当て制御部1〜3は異常が検出されたローカルRAM1〜3をワークメモリとするプログラム1〜3を、他コアがワークメモリとするローカルRAM1〜3をワークメモリにして実行を継続する(S150)。この「他コア」は例えばコア間通信部1〜3の空き容量が最も大きいコアである。または、比較的低い優先度のプログラム1〜3を実行しているコアでもよい。ここでは、監視対象のコア1〜3に割り当てるとする。
・ローカルRAM1の異常
割り当て制御部1は、プログラム1のワークメモリをローカルRAM2に変更する。
・ローカルRAM2の異常
割り当て制御部2は、プログラム2のワークメモリをローカルRAM3に変更する。
・ローカルRAM3の異常
割り当て制御部3は、プログラム3のワークメモリをローカルRAM1に変更する。
Next, when any abnormality is detected in the local RAMs 1 to 3 (Yes in S120), the allocation control units 1 to 3 use the programs 1 to 3 in which the local RAMs 1 to 3 in which the abnormality is detected are used as work memories. And the priorities of the other programs 1 to 3 are compared (S130). This determination is performed by the core allocation control unit 43 that detects an abnormality in the local RAMs 1 to 3.
The abnormal allocation control unit 1 of the local RAM 1 compares the priorities of the program 1 and the programs 2 and 3. The abnormal allocation control unit 2 of the local RAM 2 compares the priorities of the program 2 and the programs 1 and 3. The abnormality allocation control unit 3 of the RAM 3 compares the priorities of the program 3 and the programs 1 and 2. The programs 1 to 1 have lower priorities than the programs 1 to 3 in which the local RAMs 1 to 3 in which an abnormality is detected are used as work memories. If there is no 3 (No in S140), since the priority of the programs 1 to 3 using the local RAMs 1 to 3 in which the abnormality is detected is the lowest, the assignment control units 1 to 3 detect the abnormality. The programs 1 to 3 that use the local RAMs 1 to 3 as work memories and the local RAMs 1 to 3 that use other cores as work memories The execution is continued in the memory (S150). This “other core” is, for example, a core having the largest free capacity of the inter-core communication units 1 to 3. Or the core which is executing the programs 1-3 of a comparatively low priority may be sufficient. Here, it is assumed that the cores 1 to 3 to be monitored are assigned.
The abnormal allocation control unit 1 of the local RAM 1 changes the work memory of the program 1 to the local RAM 2.
The abnormal allocation control unit 2 in the local RAM 2 changes the work memory of the program 2 to the local RAM 3.
The abnormal allocation control unit 3 in the local RAM 3 changes the work memory of the program 3 to the local RAM 1.

こうすることで、各コア1〜3は、実行速度は低下しても優先度の低いプログラム1〜3を継続して実行することができる。   By doing so, each of the cores 1 to 3 can continuously execute the programs 1 to 3 having a low priority even if the execution speed decreases.

異常が検出されたローカルRAM1〜3をワークメモリにしていたプログラム1〜3よりも優先度が低いプログラム1〜3がある場合(S140のYes)、割り当て制御部1〜3は優先度のより高いプログラム1〜3を、コア1〜3が専用組み合わせのローカルRAM1〜3をワークメモリとして実行するように、コア1〜3とローカルRAM1〜3の組合せを変更する(S160)。この場合、専用組み合わせでないコアとローカルRAMで実行されるのは、最も優先度の低いプログラム31である。
・ローカルRAM1の異常
プログラム1、3>プログラム2
割り当て制御部1は、最も優先度の低いプログラム2を実行しているコア2にプログラム1を割り当て、専用組み合わせになるようにワークメモリをローカルRAM2に変更する。また、割り当て制御部1は、ワークメモリを変更することなく、プログラム1の割り当て先のコア2が実行していたプログラム2を自コア(コア1)に割り当てる。
プログラム1、2>プログラム3
プログラム2、コア2,ローカルRAM2を、プログラム3、コア3,ローカルRAM3で置き換えた関係になる。
・ローカルRAM2の異常
プログラム1,2>プログラム3
割り当て制御部2は、最も優先度の低いプログラム3を実行しているコア3にプログラム2を割り当て、専用組み合わせになるようにワークメモリをローカルRAM3に変更する。また、割り当て制御部2は、ワークメモリを変更することなく、プログラム2の割り当て先のコア3が実行していたプログラム3を自コア(コア2)に割り当てる。
プログラム2、3>プログラム1
プログラム3、コア3,ローカルRAM3を、プログラム1、コア1,ローカルRAM1で置き換えた関係になる。
・ローカルRAM3の異常
プログラム2,3>プログラム1
割り当て制御部3は、最も優先度の低いプログラム1を実行しているコア1にプログラム3を割り当て、専用組み合わせになるようにワークメモリをローカルRAM1に変更する。また、割り当て制御部3は、ワークメモリを変更することなく、プログラム3の割り当て先のコア1が実行していたプログラム1を自コア(コア3)に割り当てる。
プログラム1,3>プログラム2
プログラム1、コア1,ローカルRAM1を、プログラム2、コア2,ローカルRAM2で置き換えた関係になる。
When there are programs 1 to 3 having lower priorities than programs 1 to 3 in which the local RAMs 1 to 3 in which the abnormality is detected are used as work memories (Yes in S140), the assignment control units 1 to 3 have higher priorities. The combination of the cores 1 to 3 and the local RAMs 1 to 3 is changed so that the programs 1 to 3 are executed by using the local RAMs 1 to 3 of the dedicated combination of the cores 1 to 3 (S160). In this case, it is the program 31 with the lowest priority that is executed by the core and the local RAM that are not the dedicated combination.
Local RAM 1 abnormal program 1, 3> program 2
The assignment control unit 1 assigns the program 1 to the core 2 executing the program 2 having the lowest priority, and changes the work memory to the local RAM 2 so as to obtain a dedicated combination. Further, the allocation control unit 1 allocates the program 2 executed by the core 2 to which the program 1 is allocated without changing the work memory to the own core (core 1).
Program 1, 2> Program 3
The program 2, the core 2, and the local RAM 2 are replaced with the program 3, the core 3, and the local RAM 3.
-Abnormal program 1, 2> program 3 in local RAM 2
The assignment control unit 2 assigns the program 2 to the core 3 executing the program 3 having the lowest priority, and changes the work memory to the local RAM 3 so as to obtain a dedicated combination. Further, the allocation control unit 2 allocates the program 3 executed by the core 3 to which the program 2 is allocated without changing the work memory to the own core (core 2).
Program 2, 3> Program 1
The program 3, the core 3, and the local RAM 3 are replaced with the program 1, the core 1, and the local RAM 1.
-Abnormal program 2, 3> program 1 in local RAM 3
The assignment control unit 3 assigns the program 3 to the core 1 executing the program 1 having the lowest priority, and changes the work memory to the local RAM 1 so as to obtain a dedicated combination. The assignment control unit 3 assigns the program 1 executed by the core 1 to which the program 3 is assigned without changing the work memory to the own core (core 3).
Program 1, 3> Program 2
The program 1, the core 1, and the local RAM 1 are replaced with the program 2, the core 2, and the local RAM 2.

こうすることで、優先度のより高いプログラム1〜3は専用組み合わせで処理されるので実行速度の低下を防止でき、優先度のより低いプログラム1〜3も継続して実行することができる。   By doing so, since the programs 1 to 3 with higher priority are processed in a dedicated combination, a decrease in execution speed can be prevented, and the programs 1 to 3 with lower priority can be continuously executed.

また、ローカルRAM1〜3に異常が検出された場合、複数のプログラム1〜3が1つのローカルRAM1〜3を共有することになるので、割り当て制御部1〜3はローカルRAM1〜3の領域毎にプログラム1〜3を割り当てる。この際、優先度の高いプログラム1〜3に多くの領域を割り当てることで(例えば、優先度が高と中又は中と低の組み合わせでは3対2、優先度が高と低の組み合わせでは3対1などとする)、メモリスワップを少なくでき、優先度の高いプログラム1〜3をより高速に実行できるようになる。なお、領域の割り当ては、例えばコア間通信部1〜3により実現される。   Further, when an abnormality is detected in the local RAMs 1 to 3, the plurality of programs 1 to 3 share one local RAM 1 to 3. Assign programs 1-3. At this time, by assigning many areas to the programs 1 to 3 having high priority (for example, 3 to 2 for a combination of high and medium or medium and low, and 3 for a combination of high and low priority) 1), the memory swap can be reduced, and the programs 1 to 3 having higher priority can be executed at higher speed. The area allocation is realized by, for example, the inter-core communication units 1 to 3.

なお、ローカルRAM1〜3の一部の異常が検出された場合に、一部のプログラムだけを移動することもできる。例えば、コア1がローカルRAM1をワークメモリにしてプログラム1,4を実行中、ローカルRAM1の一部に異常が検出された場合、優先度の高いプログラム1はコア1がローカルRAM1をワークメモリして実行を継続し、優先度の低いプログラム4はコア1がローカルRAM2又は3をワークメモリして実行する。こうすることで、ローカルRAM1の一部の異常が検出された場合に、プログラム1〜4の配置を最低化できる。   Note that if some abnormalities in the local RAMs 1 to 3 are detected, only some programs can be moved. For example, when the core 1 is executing the programs 1 and 4 with the local RAM 1 as the work memory and an abnormality is detected in a part of the local RAM 1, the program 1 having a higher priority causes the core 1 to have the local RAM 1 as the work memory. The execution is continued, and the program 4 having a low priority is executed by the core 1 using the local RAM 2 or 3 as a work memory. By doing so, the arrangement of the programs 1 to 4 can be minimized when some abnormality of the local RAM 1 is detected.

以上説明したように、本実施形態のマイコン100は、コア1〜3又はローカルRAM1〜3に異常が検出された場合、優先度が高いプログラムを専用組み合わせで実行するようにコア13とローカルRAM15の組合せを変更するので、優先度の高いプログラム31は正常時と同等の速度で実行が継続される。また、優先度の低いプログラムは実行速度は低下しても継続して実行される。   As described above, the microcomputer 100 according to the present embodiment allows the core 13 and the local RAM 15 to execute a program having a high priority in a dedicated combination when an abnormality is detected in the cores 1 to 3 or the local RAMs 1 to 3. Since the combination is changed, the execution of the program 31 having a high priority is continued at a speed equivalent to that at the normal time. A program with a low priority is continuously executed even if the execution speed is lowered.

〔変形例〕
<マルチプロセッサ>
図8は、マルチプロセッサ型のマイコン100のハードウェア構成図の一例を示す。図8において図3と同一部には同一の符号を付しその説明は省略する。このマイコン100は図3と同様にCPU1〜3を有しているが、各CPU1〜3は1つのプロセッサ21に搭載されている。この場合、プロセッサ21とCPU1〜3はほぼ同じ意味になる場合がある。したがって各プロセッサ21は、DMAC22の調停を受けてマルチレイヤバス28を介して他のプロセッサ21と通信する。
[Modification]
<Multiprocessor>
FIG. 8 shows an example of a hardware configuration diagram of the multiprocessor type microcomputer 100. 8, the same parts as those in FIG. 3 are denoted by the same reference numerals, and the description thereof is omitted. The microcomputer 100 has CPUs 1 to 3 as in FIG. 3, but each CPU 1 to 3 is mounted on one processor 21. In this case, the processor 21 and the CPUs 1 to 3 may have substantially the same meaning. Accordingly, each processor 21 communicates with other processors 21 via the multilayer bus 28 under the arbitration of the DMAC 22.

しかしながら、異常監視部1〜3の監視形態及び監視方法、停止部1〜3の停止方法、並びに、割り当て制御部1〜3のプログラム1〜3の割り当て方法はマルチコアの場合と同じである。   However, the monitoring mode and monitoring method of the abnormality monitoring units 1 to 3, the stopping method of the stopping units 1 to 3, and the allocation method of the programs 1 to 3 of the allocation control units 1 to 3 are the same as in the multi-core case.

したがって、本実施形態のコア1〜3がプログラム1〜3を実行する際のコア1〜3とローカルRAM1〜3の組合わせの変更は、マルチプロセッサ型のマイコン100についても有効である。   Therefore, the change of the combination of the cores 1 to 3 and the local RAMs 1 to 3 when the cores 1 to 3 of the present embodiment execute the programs 1 to 3 is also effective for the multiprocessor microcomputer 100.

<マスター・スレーブ型>
図9は、マルチコア型又はマルチプロセッサ型のマイコン100において、コア1、2のフェールセーフ処理を1つのコア13が集中的に制御する場合の機能ブロック図の一例を示す。この場合のハードウェア構成は図3又は図8のどちらでもよい。また、図10は、コア3がコア1、2を監視する手順のシーケンス図の一例である。
<Master / slave type>
FIG. 9 shows an example of a functional block diagram when one core 13 centrally controls the fail-safe processing of the cores 1 and 2 in the multi-core type or multi-processor type microcomputer 100. The hardware configuration in this case may be either FIG. 3 or FIG. FIG. 10 is an example of a sequence diagram of a procedure in which the core 3 monitors the cores 1 and 2.

図9に示すように、コア3が異常監視部41、停止部42及び割り当て制御部43を有する。コア3は、異常監視等の専用のコアでもよいし、図3などのようにプログラム31を実行してもよく、処理能力などにより設計できる。   As illustrated in FIG. 9, the core 3 includes an abnormality monitoring unit 41, a stopping unit 42, and an allocation control unit 43. The core 3 may be a dedicated core for abnormality monitoring or the like, or may execute the program 31 as shown in FIG.

図10のステップS300とS400はいずれもコア3が図7と同様の手順を行うステップである。コア3は、ステップS300ではコア1に対し、S400ではコア2に対し、それぞれ図7の制御を行う。すなわち、異常監視部41は、コア1、2に異常が検出される否かを監視し、また、ローカルRAM1,2に異常が検出されるか否かを監視する。コア1又は2に異常が検出された場合、停止部42はコア1又はコア2を停止する。   Steps S300 and S400 in FIG. 10 are steps in which the core 3 performs the same procedure as in FIG. The core 3 controls the core 1 in step S300 and the core 2 in step S400, respectively. That is, the abnormality monitoring unit 41 monitors whether or not an abnormality is detected in the cores 1 and 2, and monitors whether or not an abnormality is detected in the local RAMs 1 and 2. When an abnormality is detected in the core 1 or 2, the stop unit 42 stops the core 1 or the core 2.

例えば、コア1に異常が検出された場合、割り当て制御部43は、コア2が優先度の高いプログラム1,2を、ローカルRAM2をワークエリアにして実行するように、コア1、2とローカルRAM2の組合せを変更する。優先度の低いプログラム1,2は、コア2がローカルRAM1をワークエリアにして実行することになる。コア2に異常が検出された場合はこの逆になる。   For example, when an abnormality is detected in the core 1, the assignment control unit 43 causes the cores 1 and 2 and the local RAM 2 to execute the programs 1 and 2 having a high priority using the local RAM 2 as a work area. Change the combination. The programs 1 and 2 with low priority are executed by the core 2 using the local RAM 1 as a work area. The reverse is true when an abnormality is detected in the core 2.

また、ローカルRAM1に異常が検出された場合、割り当て制御部43は、コア2が優先度の高いプログラム1又は2をローカルRAM2をワークエリアにして実行するように、コア1、2とプログラム1,2の組合せを変更する。優先度の低いプログラム1又は2は、コア1がローカルRAM2をワークエリアにして実行することになる。ローカルRAM2に異常が検出された場合はこの逆になる。   Further, when an abnormality is detected in the local RAM 1, the allocation control unit 43 causes the cores 1 and 2 and the programs 1 and 2 so that the core 2 executes the program 1 or 2 having a high priority with the local RAM 2 as a work area. Change the combination of 2. The low priority program 1 or 2 is executed by the core 1 using the local RAM 2 as a work area. The reverse is true when an abnormality is detected in the local RAM 2.

このように、本実施形態のプログラムとワークメモリの組合せは、各コアがそれぞれ制御することも、マスター・スレーブ型で1つのコアが制御することもできる。   As described above, the combination of the program and the work memory of this embodiment can be controlled by each core, or can be controlled by one core in the master / slave type.

12 コア間通信部
13 コア
14 リセット回路
15 ローカルRAM
21 プロセッサ
22 DMAC
23 SDRAM
24 ROM
25 I/Oブリッジ
28 マルチレイヤバス
41 異常監視部
42 停止部
43 割り当て制御部
100 マイコン

12 Inter-core communication unit 13 Core 14 Reset circuit 15 Local RAM
21 processor 22 DMAC
23 SDRAM
24 ROM
25 I / O bridge 28 Multi-layer bus 41 Abnormality monitoring unit 42 Stopping unit 43 Allocation control unit 100 Microcomputer

Claims (10)

ローカルメモリとコアが対に配置され、コアが対のローカルメモリを作業メモリとしてプログラムを実行するCPUを2つ以上有するマイコンであって、
コア又はローカルメモリの異常を検出する異常検出手段と、
各プログラムの優先度が登録された優先度テーブルと、
コア又はローカルメモリの異常が検出された場合、優先度の高いプログラムほど優先的に、コアが該コアと対のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更するリソース割り当て変更手段と、
を有するマイコン。
A microcomputer in which a local memory and a core are arranged in pairs, and the core has two or more CPUs that execute programs using the paired local memory as a working memory,
An anomaly detection means for detecting an anomaly in the core or local memory;
A priority table in which the priority of each program is registered;
A resource that changes the combination of the core and the working memory so that when the abnormality of the core or the local memory is detected, the core executes the local memory paired with the core as the working memory preferentially. Allocation change means;
A microcomputer having
前記リソース割り当て変更手段は、コアが該コアと対のローカルメモリを作業メモリとして実行できない優先度の低いプログラムを、コアが該コアと対でないローカルメモリを作業メモリとして実行するように、コアとローカルメモリの組合せを変更する、
請求項1記載のマイコン。
The resource allocation changing unit is configured to execute a low-priority program in which the core cannot execute a local memory paired with the core as a working memory, and execute a local memory that is not paired with the core as a working memory. Change the memory combination,
The microcomputer according to claim 1.
前記異常検出手段が異常を検出した第1のコアが実行していた第1のプログラムの優先度が、第2のコアが実行している第2のプログラムよりも高い場合、
前記リソース割り当て変更手段は、前記第2のコアが前記第1のプログラムを前記第2のコアと対の第2のローカルメモリを作業メモリとして実行するようにコアと作業メモリの組合せを変更する、
請求項1又は2記載のマイコン。
When the priority of the first program executed by the first core in which the abnormality detection unit has detected an abnormality is higher than the second program executed by the second core,
The resource allocation changing means changes a combination of the core and the working memory so that the second core executes the first program as a working memory using a second local memory paired with the second core.
The microcomputer according to claim 1 or 2.
前記リソース割り当て変更手段は、前記第2のコアが前記第2のプログラムを前記第1のコアと対の第1のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更する、
請求項3記載のマイコン。
The resource allocation changing unit changes a combination of the core and the working memory so that the second core executes the second program using the first local memory paired with the first core as the working memory. ,
The microcomputer according to claim 3.
前記異常検出手段が異常を検出した第1のコアが実行していた第1のプログラムの優先度が、第2のコアが実行している前記第2のプログラムよりも低い場合、
前記リソース割り当て変更手段は、前記第2のコアが第1のプログラムを前記第1のコアと対の第1のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更する、
請求項1〜4いずれか1項記載のマイコン。
When the priority of the first program executed by the first core in which the abnormality detection unit has detected an abnormality is lower than the second program executed by the second core,
The resource allocation changing unit changes a combination of the core and the working memory so that the second core executes the first program as a working memory with the first local memory paired with the first core.
The microcomputer according to any one of claims 1 to 4.
前記異常検出手段が異常を検出した第1のローカルメモリを作業メモリとして第1のコアが実行していた第1のプログラムの優先度が、第2のローカルメモリを作業メモリとして第2のコアが実行していた第2のプログラムよりも高い場合、
前記リソース割り当て変更手段は、前記第2のコアが前記第1のプログラムを前記第2のコアと対の前記第2のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更する、
請求項1〜5いずれか1項記載のマイコン。
The priority of the first program executed by the first core using the first local memory in which the abnormality detection means has detected an abnormality as the working memory is the priority of the second program using the second local memory as the working memory. If it is higher than the second program that was running,
The resource allocation changing unit changes a combination of the core and the working memory so that the second core executes the first program as the working memory using the second local memory paired with the second core. To
The microcomputer according to any one of claims 1 to 5.
前記リソース割り当て変更手段は、前記第1のコアが前記第2のプログラムを前記第2のコアと対の前記第2のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更する、請求項6記載のマイコン。   The resource allocation changing unit changes a combination of the core and the working memory so that the first core executes the second program with the second local memory paired with the second core as a working memory. The microcomputer according to claim 6. 前記異常検出手段が異常を検出した第1のローカルメモリを作業メモリとして第1のコアが実行していた第1のプログラムの優先度が、第2のローカルメモリを作業メモリとして第2のコアが実行していた第2のプログラムよりも低い場合、
前記リソース割り当て変更手段は、前記第1のコアが前記第1のプログラムを前記第2のコアと対の前記第2のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更する、請求項6又は7記載のマイコン。
The priority of the first program executed by the first core using the first local memory in which the abnormality detection means has detected an abnormality as the working memory is the priority of the second program using the second local memory as the working memory. If it is lower than the second program that was running,
The resource allocation changing unit changes a combination of the core and the working memory so that the first core executes the first program as the working memory using the second local memory paired with the second core. The microcomputer according to claim 6 or 7.
前記異常検出手段がコアの異常を検出した場合、異常が検出されたコアを停止するコア停止手段と、
を有する請求項1〜8いずれか1項記載のマイコン。
When the abnormality detecting means detects a core abnormality, a core stopping means for stopping the core in which the abnormality is detected;
The microcomputer according to claim 1, comprising:
ローカルメモリとコアが対に配置され、コアが対のローカルメモリを作業メモリとするCPUを2つ以上有するマイコンのリソース割り当て方法であって、
異常検出手段が、コア又はローカルメモリの異常を検出するステップと、
コア又はローカルメモリの異常が検出された場合、リソース割り当て変更手段が、各プログラムの優先度が登録された優先度テーブルを参照して、
優先度の高いプログラムほど優先的に、コアが該コアと対のローカルメモリを作業メモリとして実行するように、コアと作業メモリの組合せを変更するステップと、
を有するリソース割り当て方法。
A resource allocation method for a microcomputer having two or more CPUs in which a local memory and a core are arranged in pairs, and the core uses the paired local memory as a working memory,
An abnormality detecting means for detecting an abnormality of the core or the local memory; and
When an abnormality of the core or local memory is detected, the resource allocation changing means refers to the priority table in which the priority of each program is registered,
Changing the combination of the core and the working memory so that the higher priority program has priority, and the core executes the local memory paired with the core as the working memory;
A resource allocation method comprising:
JP2010283151A 2010-12-20 2010-12-20 Microcomputer and resource allocation method Pending JP2012133458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010283151A JP2012133458A (en) 2010-12-20 2010-12-20 Microcomputer and resource allocation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010283151A JP2012133458A (en) 2010-12-20 2010-12-20 Microcomputer and resource allocation method

Publications (1)

Publication Number Publication Date
JP2012133458A true JP2012133458A (en) 2012-07-12

Family

ID=46649009

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010283151A Pending JP2012133458A (en) 2010-12-20 2010-12-20 Microcomputer and resource allocation method

Country Status (1)

Country Link
JP (1) JP2012133458A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015229467A (en) * 2014-06-06 2015-12-21 本田技研工業株式会社 Electronic control system
JP2021026577A (en) * 2019-08-07 2021-02-22 三菱電機株式会社 Control device, arithmetic unit, control method, and control program
JP2021172142A (en) * 2020-04-21 2021-11-01 株式会社東海理化電機製作所 Abnormality detection device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015229467A (en) * 2014-06-06 2015-12-21 本田技研工業株式会社 Electronic control system
JP2021026577A (en) * 2019-08-07 2021-02-22 三菱電機株式会社 Control device, arithmetic unit, control method, and control program
JP2021172142A (en) * 2020-04-21 2021-11-01 株式会社東海理化電機製作所 Abnormality detection device
JP7332529B2 (en) 2020-04-21 2023-08-23 株式会社東海理化電機製作所 Anomaly detector

Similar Documents

Publication Publication Date Title
US10628275B2 (en) Runtime software-based self-test with mutual inter-core checking
US9690719B2 (en) Mechanism for managing access to at least one shared integrated peripheral of a processing unit and a method of operating thereof
US9032482B2 (en) Information processing apparatus and control method
US20120110303A1 (en) Method for Process Synchronization of Embedded Applications in Multi-Core Systems
JP4457047B2 (en) Multiprocessor system
KR101067264B1 (en) Method and device for controlling a computer system
JP4874165B2 (en) Multiprocessor system and access right setting method in multiprocessor system
US20110161644A1 (en) Information processor
CN104798046A (en) Symmetric multi-processor arrangement, safety critical system, and method therefor
JP2008242593A (en) Multiprocessor system, and access protection method for multiprocessor system
GB2601728A (en) Data processing systems
US20080022052A1 (en) Bus Coupled Multiprocessor
JP2012133458A (en) Microcomputer and resource allocation method
JP2008033890A (en) Microcomputer system
JP5996110B2 (en) Computer system and control method
JP7236811B2 (en) Information processing equipment
US20240004767A1 (en) Data processing systems
JP2012113632A (en) Information processor and method of managing exclusive access right of information processor
JP2010092101A (en) Information processor
JP2020204877A (en) Semiconductor device and method for operating the same
JP2013164873A (en) Multiprocessor system
JP2019126034A (en) Service request interrupt router for virtual interrupt service providers
JP4853620B2 (en) Multiprocessor system and initial startup method and program
JP6645467B2 (en) Microcomputer
JP3540119B2 (en) Interrupt routing mechanism and multiprocessor control method