JP2016165912A - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP2016165912A
JP2016165912A JP2015045426A JP2015045426A JP2016165912A JP 2016165912 A JP2016165912 A JP 2016165912A JP 2015045426 A JP2015045426 A JP 2015045426A JP 2015045426 A JP2015045426 A JP 2015045426A JP 2016165912 A JP2016165912 A JP 2016165912A
Authority
JP
Japan
Prior art keywords
core
time
phase
task
electronic control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2015045426A
Other languages
Japanese (ja)
Other versions
JP6394442B2 (en
Inventor
政昭 玉腰
Masaaki Tamakoshi
政昭 玉腰
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2015045426A priority Critical patent/JP6394442B2/en
Priority to DE102016203418.9A priority patent/DE102016203418A1/en
Publication of JP2016165912A publication Critical patent/JP2016165912A/en
Application granted granted Critical
Publication of JP6394442B2 publication Critical patent/JP6394442B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

PROBLEM TO BE SOLVED: To provide an electronic control device which can surely prevent the occurrence of a phenomenon that a task is not executed in a specified phase accompanied by the changeover of a cores for executing the task, and the duplicate execution of the task.SOLUTION: This electronic control device 10 comprises a microcomputer 100 mounted with a plurality of cores C1, C2, and executes a synchronous task in synchronization with a phase of a rotation angle in the cores C1, C2. The electronic control device 10 comprises a first storage part 131 which stores a core number indicating the synchronization task execution core, and a second storage part 132 which stores a changeover phase indicating a phase when the synchronization task execution core is switched. The electronic control device 10 switches the synchronization task execution core on the basis of the core number which is stored in the first storage part 131 and the changeover phase which is stored in the second storage part 132.SELECTED DRAWING: Figure 1

Description

本発明は、複数のコアを搭載したマルチコアマイクロコンピュータを備える電子制御装置に関する。   The present invention relates to an electronic control device including a multi-core microcomputer equipped with a plurality of cores.

車両に備えられる電子制御装置として、複数のコアを搭載したマルチコアマイクロコンピュータ(以下、「マルチコアマイコン」とも表記する)を備えたものが実用化されている。マルチコアマイコンは、制御において実行される複数のタスクを、複数のコアにて分散処理するものである。それぞれのコアにおける処理負荷が軽減されるので、複雑な処理を比較的高速で実行することができる。   As an electronic control device provided in a vehicle, a device including a multi-core microcomputer (hereinafter also referred to as “multi-core microcomputer”) equipped with a plurality of cores has been put into practical use. A multi-core microcomputer performs distributed processing of a plurality of tasks executed in control by a plurality of cores. Since the processing load on each core is reduced, complex processing can be executed at a relatively high speed.

このような電子制御装置では、一部のコアにおける処理負荷のみが大きくなり過ぎることの無いよう、タスクを実行するコアの動的な切り替えが行われる(例えば、下記特許文献1を参照)。   In such an electronic control device, dynamic switching of cores that execute tasks is performed so that only the processing load in some cores does not become too large (see, for example, Patent Document 1 below).

例えば、あるタスクの実行が割り当てられた第1コアの処理負荷が大きく、且つ第2コアの処理負荷が小さいときには、当該タスクを実行するコアが第1コアから第2コアへと切り替えられる。   For example, when the processing load of the first core to which execution of a certain task is assigned is large and the processing load of the second core is small, the core that executes the task is switched from the first core to the second core.

ところで、電子制御装置により実行されるタスクの中には、制御対象装置における回転角(内燃機関のクランク角など)の位相に同期して実行されるべきものがある。このようなタスクとしては、例えば、クランク角が所定の位相となる毎に開始される、燃料噴射タイミングの演算が挙げられる。また、同じくクランク角が所定の位相となる毎に開始される、点火タイミングの演算が挙げられる。   Incidentally, some tasks executed by the electronic control device should be executed in synchronization with the phase of the rotation angle (such as the crank angle of the internal combustion engine) in the control target device. An example of such a task is calculation of fuel injection timing that is started every time the crank angle reaches a predetermined phase. In addition, calculation of ignition timing that is started every time the crank angle reaches a predetermined phase can be mentioned.

特開2014−78078号公報JP 2014-78078 A

上記のような電子制御装置において、タスクを実行するコアが切り替えられるタイミングによっては、回転角の位相が特定の位相となったときに実行されるべきタスクが、当該位相においていずれのコアでも実行されない場合が生じることがある。加えて、回転角の位相が特定の位相となったときに実行されるべきタスクが、複数のコアで重複して実行されてしまう場合が生じることもある。   In the electronic control device as described above, depending on the timing at which the core that executes the task is switched, the task to be executed when the phase of the rotation angle becomes a specific phase is not executed by any core in the phase. Cases may arise. In addition, the task that should be executed when the phase of the rotation angle reaches a specific phase may be executed repeatedly by a plurality of cores.

このような現象は、タスクの処理が開始されるタイミングがコア間で異なること、及び、タスクを実行するコアの切り替えが、タスクの処理が開始されるタイミングとは非同期に行われてしまうことに起因する。   Such a phenomenon is that the timing at which task processing is started differs between cores, and the switching of a core that executes a task is performed asynchronously with the timing at which task processing is started. to cause.

本発明はこのような課題に鑑みてなされたものであり、その目的は、タスクを実行するコアの切り替えに伴い、特定の位相においてタスクが実行されない現象や、タスクが重複して実行されてしまう現象を確実に防止することのできる電子制御装置を提供することにある。   The present invention has been made in view of such problems. The purpose of the present invention is that a task is not executed in a specific phase, or a task is executed redundantly, when a core for executing the task is switched. An object of the present invention is to provide an electronic control device that can reliably prevent the phenomenon.

上記課題を解決するために、本発明に係る電子制御装置は、複数のコアを搭載したマルチコアマイクロコンピュータを備えており、コアにおいて、回転角の位相に同期してタスクを実行する電子制御装置であって、タスクを実行するタスク実行コア、を示すコア番号を記憶する第1記憶部と、タスク実行コアの切り替えが行われる際の位相、を示す切り替え位相を記憶する第2記憶部と、を備え、第1記憶部に記憶されているコア番号、及び、第2記憶部に記憶されている切り替え位相に基づいて、タスク実行コアの切り替えを行う。   In order to solve the above-described problems, an electronic control device according to the present invention includes a multi-core microcomputer equipped with a plurality of cores, and the electronic control device executes a task in synchronization with the phase of the rotation angle in the core. A first storage unit that stores a core number indicating a task execution core that executes a task, and a second storage unit that stores a switching phase indicating a phase when the task execution core is switched. The task execution core is switched based on the core number stored in the first storage unit and the switching phase stored in the second storage unit.

このような構成の電子制御装置では、タスク実行コアの切り替えが、予め設定され記憶されている情報(コア番号及び切り替え位相)に基づいて行われる。   In the electronic control device having such a configuration, switching of task execution cores is performed based on information (core number and switching phase) set and stored in advance.

例えば、切り替えの前においてタスクを実行していたコアは、当該タスクを実行しない状態への切り替えを、位相が切り替え位相となったタイミングで行う。また、切り替えの後においてタスクを実行することとなるコアは、当該タスクを実行する状態への切り替えを、やはり位相が切り替え位相となったタイミングで行う。   For example, a core that has executed a task before switching performs switching to a state in which the task is not executed at the timing when the phase becomes the switching phase. Further, the core that will execute the task after switching performs switching to the state in which the task is executed at the timing when the phase becomes the switching phase.

このように、状態の切り替えが行われるタイミング(位相)を、全てのコアで一致させることが可能となる。その結果、特定の位相においていずれのコアでもタスクが実行されない現象や、複数のコアで重複してタスクが実行されてしまう現象が確実に防止される。   In this way, the timing (phase) at which the state is switched can be made to coincide in all the cores. As a result, a phenomenon that a task is not executed by any core in a specific phase and a phenomenon that a task is executed repeatedly by a plurality of cores are surely prevented.

本発明によれば、タスクを実行するコアの切り替えに伴い、特定の位相においてタスクが実行されない現象や、タスクが重複して実行されてしまう現象を確実に防止することのできる電子制御装置が提供される。   According to the present invention, there is provided an electronic control device capable of reliably preventing a phenomenon in which a task is not executed in a specific phase or a phenomenon in which a task is executed repeatedly due to switching of a core for executing the task. Is done.

本発明の実施形態に係る電子制御装置の構成を模式的に示す図である。It is a figure which shows typically the structure of the electronic control apparatus which concerns on embodiment of this invention. 図1の電子制御装置で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating the switching of the synchronous task execution core performed with the electronic controller of FIG. 図1の電子制御装置で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating the switching of the synchronous task execution core performed with the electronic controller of FIG. 図1の電子制御装置で実行される処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed with the electronic controller of FIG. 図1の電子制御装置におけるコアの処理負荷を示す図である。It is a figure which shows the processing load of the core in the electronic controller of FIG. 図1の電子制御装置におけるコアの処理負荷を示す図である。It is a figure which shows the processing load of the core in the electronic controller of FIG. 図1の電子制御装置におけるコアの処理負荷を示す図である。It is a figure which shows the processing load of the core in the electronic controller of FIG. 図1の電子制御装置で実行される処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed with the electronic controller of FIG. 同期タスク実行コアの切り替えが行われる際における、コアの状態遷移図である。It is a state transition diagram of a core when switching of a synchronous task execution core is performed. 本発明の比較例に係る電子制御で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating switching of the synchronous task execution core performed by the electronic control which concerns on the comparative example of this invention. 本発明の比較例に係る電子制御で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating switching of the synchronous task execution core performed by the electronic control which concerns on the comparative example of this invention. 本発明の比較例に係る電子制御で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating switching of the synchronous task execution core performed by the electronic control which concerns on the comparative example of this invention. 本発明の比較例に係る電子制御で実行される、同期タスク実行コアの切り替えについて説明するためのタイムチャートである。It is a time chart for demonstrating switching of the synchronous task execution core performed by the electronic control which concerns on the comparative example of this invention.

以下、添付図面を参照しながら本発明の実施形態について説明する。説明の理解を容易にするため、各図面において同一の構成要素に対しては可能な限り同一の符号を付して、重複する説明は省略する。   Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In order to facilitate the understanding of the description, the same constituent elements in the drawings will be denoted by the same reference numerals as much as possible, and redundant description will be omitted.

本実施形態に係る電子制御装置10は、車両における内燃機関20(エンジン)の動作を制御するための制御装置(エンジン制御ECU)として構成されている。例えば、電子制御装置10は、内燃機関20に備えられたクランク角センサ(不図示)からの信号に基づいて、内燃機関20におけるインジェクタ(不図示)の開閉動作、すなわち燃料噴射を制御する。   The electronic control device 10 according to the present embodiment is configured as a control device (engine control ECU) for controlling the operation of the internal combustion engine 20 (engine) in the vehicle. For example, the electronic control unit 10 controls the opening / closing operation of an injector (not shown) in the internal combustion engine 20, that is, fuel injection, based on a signal from a crank angle sensor (not shown) provided in the internal combustion engine 20.

かかる制御において、電子制御装置10で処理されるタスクの中には、クランクシャフトの回転角(クランク角)の位相の変化に同期して周期的に処理されるものがある。例えば、インジェクタの燃料噴射タイミングを決定するための演算は、上記位相が30度増加する毎に処理される。以下の説明においては、上記のように回転角の位相に同期して処理されるタスクのことを、「同期タスク」と表記する。   In such control, some tasks processed by the electronic control device 10 are periodically processed in synchronization with a change in the phase of the rotation angle (crank angle) of the crankshaft. For example, the calculation for determining the fuel injection timing of the injector is processed every time the phase increases by 30 degrees. In the following description, a task processed in synchronization with the phase of the rotation angle as described above is referred to as a “synchronization task”.

電子制御装置10による同期タスクの処理についての説明に先立ち、電子制御装置10の構成について説明する。電子制御装置10は、入力回路11と、出力回路12と、マイコン100とを備えている。   Prior to the description of the synchronization task processing by the electronic control device 10, the configuration of the electronic control device 10 will be described. The electronic control device 10 includes an input circuit 11, an output circuit 12, and a microcomputer 100.

入力回路11は、制御対象である内燃機関20から、各種のセンサ信号を受信するための通信インターフェースとなる回路である。センサ信号には、クランク角センサから送信される信号、すなわち、クランク角の位相を示す信号が含まれる。   The input circuit 11 is a circuit serving as a communication interface for receiving various sensor signals from the internal combustion engine 20 to be controlled. The sensor signal includes a signal transmitted from the crank angle sensor, that is, a signal indicating the phase of the crank angle.

出力回路12は、インジェクタの開閉を切り替えるための駆動信号を、内燃機関20に向けて出力するための通信インターフェースとなる回路である。尚、出力回路12からは、インジェクタ以外の装置(例えばスパークプラグ)を動作させるための駆動信号が、上記駆動信号と共に送信されてもよい。   The output circuit 12 is a circuit serving as a communication interface for outputting a drive signal for switching opening and closing of the injector to the internal combustion engine 20. Note that a drive signal for operating a device other than the injector (for example, a spark plug) may be transmitted from the output circuit 12 together with the drive signal.

マイコン100は、電子制御装置10の主たる部分を構成するマイクロコンピュータである。マイコン100は、CPU110と、ROM120と、RAM130と、I/O140とを備えている。   The microcomputer 100 is a microcomputer that constitutes a main part of the electronic control device 10. The microcomputer 100 includes a CPU 110, a ROM 120, a RAM 130, and an I / O 140.

CPU110は、制御を実行するために必要な演算、すなわちタスクの処理を行うための中央演算処理装置である。CPU110は3つのコア(C0、C1、C2)を有しており、所謂マルチコアの処理装置となっている。つまり、マイコン100はマルチコアマイクロコンピュータとして構成されている。   The CPU 110 is a central processing unit for performing calculations necessary for executing control, that is, task processing. The CPU 110 has three cores (C0, C1, and C2), and is a so-called multi-core processing device. That is, the microcomputer 100 is configured as a multi-core microcomputer.

ROM120は、読み出し専用の半導体メモリである。ROM120には、CPU110で実行されるプログラムや、内燃機関20の制御に必要な各種のマップ等が記憶されている。   The ROM 120 is a read-only semiconductor memory. The ROM 120 stores a program executed by the CPU 110, various maps necessary for controlling the internal combustion engine 20, and the like.

RAM130は、書き換え可能な半導体メモリである。RAM130には、制御のための演算結果等が一時的に記憶される。また、本実施形態では、RAM130における情報の記憶場所として、第1記憶部131と、第2記憶部132とが確保されている。第1記憶部131に書き込まれ記憶される情報、及び、第2記憶部132に書き込まれ記憶される情報については、それぞれ後に説明する。   The RAM 130 is a rewritable semiconductor memory. The RAM 130 temporarily stores calculation results for control. In the present embodiment, a first storage unit 131 and a second storage unit 132 are secured as storage locations for information in the RAM 130. Information written and stored in the first storage unit 131 and information written and stored in the second storage unit 132 will be described later.

I/O140は、車両に搭載された他のECUと、マイコン100とが通信を行うためのインターフェース部分である。I/O140を介した上記通信は、CPU110により制御される。   The I / O 140 is an interface portion for communication between another ECU mounted on the vehicle and the microcomputer 100. The above communication via the I / O 140 is controlled by the CPU 110.

尚、上記のような電子制御装置10の構成自体は、第1記憶部131と第2記憶部132とがRAM130に確保されている点を除き、従来の電子制御の構成と同じである。   The configuration of the electronic control device 10 as described above is the same as that of the conventional electronic control except that the first storage unit 131 and the second storage unit 132 are secured in the RAM 130.

電子制御装置10は、内燃機関20の動作を制御するにあたり、既に述べた同期タスクの他にも様々なタスクの処理を行っている。本実施形態では、同期タスクを含む複数のタスクが、コアC1とコアC2とによって分散処理されている。   In controlling the operation of the internal combustion engine 20, the electronic control unit 10 performs various tasks in addition to the synchronization task described above. In the present embodiment, a plurality of tasks including a synchronization task are distributedly processed by the core C1 and the core C2.

コアC0は、CPU110全体の動作を統括制御している。具体的には、コアC1及びコアC2のそれぞれに対し、処理すべきタスクの振り分けを行っている。尚、このような統括制御は、タスクの処理を行うコアC1又はコアC2のいずれかが、タスクの処理と並行して行うこととしてもよい。その場合、本実施形態におけるコアC0のように、統括制御を行うための専用のコアは不要となる。   The core C0 controls the overall operation of the CPU 110. Specifically, tasks to be processed are assigned to each of the core C1 and the core C2. Note that such overall control may be performed in parallel with task processing by either the core C1 or the core C2 that performs task processing. In that case, a dedicated core for performing overall control is not required like the core C0 in the present embodiment.

タスクの振り分けは、コアC1及びコアC2のそれぞれの処理負荷が概ね均等となるように行われる。しかしながら、例えば、車両の走行状態の変化に伴って内燃機関20の回転数が増加した場合には、一部のタスクの実行頻度が増加するなどにより、コアC1及びコアC2のうち一方の処理負荷が、他方の処理負荷に比べて著しく大きくなってしまう場合がある。   The task distribution is performed so that the processing loads of the core C1 and the core C2 are approximately equal. However, for example, when the rotational speed of the internal combustion engine 20 increases with a change in the running state of the vehicle, the processing load of one of the core C1 and the core C2 is increased due to an increase in the frequency of execution of some tasks. However, in some cases, the processing load becomes significantly larger than the other processing load.

上記のような処理負荷の偏りは、CPU110の処理能力の有効活用という点に鑑みれば好ましいものではない。そこで、CPU110では、一部のコアにおける処理負荷のみが大きくなり過ぎることの無いように、同期タスクの処理を実行するコアが動的に切り替えられる構成となっている。例えば、同期タスクの処理がコアC1で行われている際、当該コアC1の処理負荷が大きくなり過ぎた場合には、同期タスクの処理を実行するコアがコアC1からコアC2へと切り替えられる。   Such a bias in processing load is not preferable in view of effective utilization of the processing capacity of the CPU 110. Therefore, the CPU 110 is configured to dynamically switch the core that executes the processing of the synchronization task so that only the processing load in some cores does not become too large. For example, when the processing of the synchronization task is being performed by the core C1, if the processing load of the core C1 becomes too large, the core that executes the processing of the synchronization task is switched from the core C1 to the core C2.

以下の説明においては、コアC1及びコアC2のうち、同期タスクの処理を実行するコアのことを「同期タスク実行コア」とも称する。また、同期タスク実行コアを切り替えるためにコアC0が行う処理のことを「切り替え処理」とも称する。尚、後に説明するように、コアC0が切り替え処理を行うタイミングと、同期タスク実行コアが実際に切り替えられるタイミングとは、本実施形態においては必ずしも一致しない。   In the following description, the core that executes the processing of the synchronous task among the cores C1 and C2 is also referred to as a “synchronous task execution core”. The process performed by the core C0 to switch the synchronous task execution core is also referred to as “switching process”. As will be described later, the timing at which the core C0 performs the switching process and the timing at which the synchronous task execution core is actually switched do not necessarily match in this embodiment.

本実施形態で行われる切り替え処理の具体的な態様、及びその利点について説明する前に、従来から行われていた切り替え処理の態様について説明する。図10乃至図13は、本発明の比較例(従来例)に係る電子制御装置で実行される、切り替え処理の流れを示すタイムチャートである。尚、当該電子制御装置のハードウェア構成は、図1に示される電子制御装置10の構成と同じである。   Before describing specific modes of switching processing performed in the present embodiment and advantages thereof, modes of switching processing conventionally performed will be described. 10 to 13 are time charts showing the flow of switching processing executed by the electronic control device according to the comparative example (conventional example) of the present invention. The hardware configuration of the electronic control device is the same as that of the electronic control device 10 shown in FIG.

図10を参照しながら説明する。図10には、時刻t125において切り替え処理が実行され、同期タスク実行コアがコアC1からコアC2へと切り替えられる例が示されている。   This will be described with reference to FIG. FIG. 10 shows an example in which the switching process is executed at time t125 and the synchronous task execution core is switched from the core C1 to the core C2.

同期タスクは、内燃機関20のクランク角センサから電子制御装置に伝達される情報、すなわち、クランクシャフトの回転角の位相(以下、「センサ位相」と表記する)が、30度変化する毎に実行される。具体的には、センサ位相が60度、90度、120度、150度と、30度増加する毎に、同期タスク実行コアにおいて同期タスクが実行される。尚、センサ位相は、720度まで増加した時点で0度に戻り、内燃機関20の動作に伴って再び30度ずつ増加していく。   The synchronization task is executed whenever the information transmitted from the crank angle sensor of the internal combustion engine 20 to the electronic control unit, that is, the phase of the rotation angle of the crankshaft (hereinafter referred to as “sensor phase”) changes by 30 degrees. Is done. Specifically, every time the sensor phase increases by 30 degrees, such as 60 degrees, 90 degrees, 120 degrees, and 150 degrees, the synchronization task is executed in the synchronization task execution core. The sensor phase returns to 0 degrees when it increases to 720 degrees, and increases again by 30 degrees as the internal combustion engine 20 operates.

図10の例では、時刻t125よりも前において同期タスク実行コアであるコアC1は、センサ位相が90度となった後の時刻t110において、同期タスクの処理を開始する。尚、センサ位相が90度となったタイミングと、同期タスクの処理が開始されるタイミング(時刻t110)とは必ずしも一致しない。このようなタイミングの不一致は、コアC1が同期タスク以外のタスクの処理も行っており、同期タスクの処理の開始タイミングが僅かに遅れてしまうことに起因する。センサ位相が90度となってから、同期タスクの処理が開始されるまでの時間は、同期タスク実行コアの処理負荷に応じて変化する。   In the example of FIG. 10, the core C1 that is the synchronous task execution core before the time t125 starts the processing of the synchronous task at the time t110 after the sensor phase becomes 90 degrees. Note that the timing at which the sensor phase reaches 90 degrees does not necessarily coincide with the timing (time t110) at which the synchronization task processing is started. Such timing mismatch is due to the fact that the core C1 is also processing tasks other than the synchronous task, and the start timing of the synchronous task processing is slightly delayed. The time from when the sensor phase becomes 90 degrees to when the processing of the synchronous task is started varies depending on the processing load of the synchronous task execution core.

その後、時刻t110よりも後の時刻t125において、コアC0により切り替え処理が実行される。同期タスク実行コアはコアC1からコアC2へと切り替えられる。これ以降、コアC1は、センサ位相が30度増加しても同期タスクの処理を行わない状態(以下、当該状態のことを「非実行状態」と称する)となり、コアC2は、センサ位相が30度増加する毎に同期タスクの処理を行う状態(以下、当該状態のことを「実行状態」と称する)となる。   Thereafter, the switching process is executed by the core C0 at a time t125 after the time t110. The synchronous task execution core is switched from the core C1 to the core C2. Thereafter, even if the sensor phase is increased by 30 degrees, the core C1 is in a state where the synchronous task is not processed (hereinafter, this state is referred to as “non-execution state”), and the core C2 has a sensor phase of 30. Each time it increases, a state in which a synchronous task is processed (hereinafter, this state is referred to as an “execution state”).

時刻t125の後、センサ位相が120度になったときには、コアC1は非実行状態になっている。このため、コアC1は同期タスクの処理を開始しない。図10に示される時刻t130は、仮にコアC1が実行状態であるとしたときに、120度のセンサ位相に対応した同期タスクの実行が開始される時刻である。   When the sensor phase becomes 120 degrees after time t125, the core C1 is in a non-execution state. For this reason, the core C1 does not start the synchronous task processing. A time t130 shown in FIG. 10 is a time when the execution of the synchronous task corresponding to the sensor phase of 120 degrees is started, assuming that the core C1 is in the execution state.

コアC2は、時刻t125よりも前においては同期タスク実行コアではなく、非実行状態となっている。このため、センサ位相が90度となっても、同期タスクの処理を開始しない。図10に示される時刻t120は、仮にコアC2が実行状態であるとしたときに、90度のセンサ位相に対応した同期タスクの実行がコアC2で開始される時刻である。   The core C2 is not a synchronous task execution core but is in a non-execution state before time t125. For this reason, even if the sensor phase is 90 degrees, the synchronization task processing is not started. A time t120 shown in FIG. 10 is a time at which the execution of the synchronous task corresponding to the sensor phase of 90 degrees is started in the core C2, assuming that the core C2 is in an execution state.

尚、同図に示されるように、時刻t110と時刻t120とは互いに一致していない。これは、センサ位相が90度となってから、同期タスクの処理が開始されるまでの時間が、コアC1、C2の処理負荷に応じてそれぞれ変化するからである。図10の例では、コアC2が処理を開始する時刻t120が、コアC1が処理を開始する時刻t110よりも後になっている例が示されている。ただし、コアC1及びコアC2のそれぞれの処理負荷によっては、これらの前後関係が入れ替わることも生じ得る。   As shown in the figure, time t110 and time t120 do not match each other. This is because the time from when the sensor phase becomes 90 degrees to when the processing of the synchronization task is started varies depending on the processing load of the cores C1 and C2. In the example of FIG. 10, an example is shown in which the time t120 at which the core C2 starts processing is later than the time t110 at which the core C1 starts processing. However, depending on the processing load of each of the core C1 and the core C2, these contexts may be interchanged.

時刻t120よりも後の時刻t125において、コアC0により切り替え処理が実行される。時刻t125の後、センサ位相が120度になったときには、コアC2は実行状態になっている。このため、コアC2は、120度のセンサ位相に対応した同期タスクの処理を開始する(時刻t140)。図10の例では、時刻t140は時刻t130よりも後の時刻となっている。   At time t125 after time t120, the core C0 performs the switching process. When the sensor phase becomes 120 degrees after time t125, the core C2 is in an execution state. For this reason, the core C2 starts the process of the synchronous task corresponding to the sensor phase of 120 degrees (time t140). In the example of FIG. 10, the time t140 is later than the time t130.

以上のように、コアC0による切り替え処理が時刻t125において実行されると、90度のセンサ位相に対応した同期タスクはコアC1のみで行われ、120度のセンサ位相に対応した同期タスクはコアC2のみで行われる。その結果、切り替え処理が行われなかった場合と同様に、電子制御装置10による内燃機関20の制御は正常に行われる。   As described above, when the switching process by the core C0 is executed at the time t125, the synchronization task corresponding to the sensor phase of 90 degrees is performed only by the core C1, and the synchronization task corresponding to the sensor phase of 120 degrees is the core C2. Only done. As a result, similarly to the case where the switching process is not performed, the control of the internal combustion engine 20 by the electronic control device 10 is normally performed.

図11を参照しながら、他の例について説明する。図11の例では、切り替え処理が行われるタイミングが、時刻t130よりも後であり、且つ時刻t140よりも前の時刻t135となっている点において、図10の例と異なっている。   Another example will be described with reference to FIG. The example of FIG. 11 is different from the example of FIG. 10 in that the timing at which the switching process is performed is a time t135 after the time t130 and before the time t140.

この例でも、90度のセンサ位相に対応した同期タスクの処理はコアC1で開始され(時刻t110)、コアC2では開始されない(時刻t120)。   Also in this example, the process of the synchronization task corresponding to the sensor phase of 90 degrees is started at the core C1 (time t110) and is not started at the core C2 (time t120).

時刻t130になると、この時点ではコアC1は同期タスク実行コアであり、実行状態なのであるから、コアC1は120度のセンサ位相に対応した同期タスクの処理を開始する。その後、時刻t135において切り替え処理が行われるが、既にコアC1は同期タスクの処理を行っているので、当該処理は中断されることなくそのまま継続される。   At time t130, since the core C1 is a synchronous task execution core at this time and is in an execution state, the core C1 starts processing of the synchronous task corresponding to the sensor phase of 120 degrees. Thereafter, the switching process is performed at time t135, but since the core C1 has already performed the synchronization task process, the process is continued without being interrupted.

時刻t135よりも後の時刻t140になると、この時点ではコアC2は同期タスク実行コアに切り替えられており、実行状態となっている。このため、コアC2は、120度のセンサ位相に対応した同期タスクの処理を開始する。   At time t140 after time t135, the core C2 is switched to the synchronous task execution core at this time, and is in an execution state. For this reason, the core C2 starts the process of the synchronous task corresponding to the sensor phase of 120 degrees.

その結果、120度のセンサ位相に対応した同期タスクの処理は、コアC1とコアC2の両方で開始されてしまうことになる。この場合、内燃機関20に対する駆動信号の送信が2重に送信されてしまうなどにより、内燃機関20の制御において何らかの不具合が生じてしまう可能性がある。   As a result, the processing of the synchronization task corresponding to the sensor phase of 120 degrees is started in both the core C1 and the core C2. In this case, there is a possibility that some trouble may occur in the control of the internal combustion engine 20 because the drive signal is transmitted twice to the internal combustion engine 20.

このように、従来の電子制御装置においては、切り替え処理が行われるタイミングによっては、同期タスクが複数のコアで重複して処理されてしまう場合が生じ得る。以下では、このような現象を「処理の重複」とも称する。   As described above, in the conventional electronic control apparatus, depending on the timing at which the switching process is performed, there may occur a case where the synchronization task is repeatedly processed by a plurality of cores. Hereinafter, such a phenomenon is also referred to as “duplication of processing”.

引き続き、本発明の比較例に係る電子制御装置の切り替え処理について、図12を参照しながら説明する。図12には、時刻t126において切り替え処理が実行され、同期タスク実行コアがコアC1からコアC2へと切り替えられる例が示されている。   Next, switching processing of the electronic control device according to the comparative example of the present invention will be described with reference to FIG. FIG. 12 shows an example in which the switching process is executed at time t126 and the synchronous task execution core is switched from the core C1 to the core C2.

図12では、90度のセンサ位相に対応した同期タスクの処理がコアC1で開始される時刻が、時刻t121として示されている。また、仮にコアC2が実行状態であるとしたときに、90度のセンサ位相に対応した同期タスクの実行がコアC2で開始される時刻が、時刻t111として示されている。図12の例では、時刻t121が時刻t111よりも後の時刻となっている。   In FIG. 12, the time at which the processing of the synchronization task corresponding to the sensor phase of 90 degrees is started at the core C1 is shown as time t121. Further, when the core C2 is in the execution state, the time when the execution of the synchronous task corresponding to the sensor phase of 90 degrees is started at the core C2 is indicated as a time t111. In the example of FIG. 12, time t121 is later than time t111.

同様に、図12では、120度のセンサ位相に対応した同期タスクの処理がコアC2で開始される時刻が、時刻t131として示されている。また、仮にコアC1が実行状態であるとしたときに、120度のセンサ位相に対応した同期タスクの実行がコアC1で開始される時刻が、時刻t141として示されている。図12の例では、時刻t141が時刻t131よりも後の時刻となっている。   Similarly, in FIG. 12, the time at which the processing of the synchronization task corresponding to the sensor phase of 120 degrees is started at the core C2 is shown as time t131. In addition, when the core C1 is in the execution state, the time when the execution of the synchronous task corresponding to the sensor phase of 120 degrees is started in the core C1 is indicated as a time t141. In the example of FIG. 12, time t141 is later than time t131.

時刻t126よりも前において同期タスク実行コアであるコアC1は、センサ位相が90度となった後の時刻t121において、同期タスクの処理を開始する。その後、時刻t121よりも後の時刻t126において、コアC0により切り替え処理が実行される。同期タスク実行コアはコアC1からコアC2へと切り替えられる。   Prior to time t126, the core C1, which is a synchronous task execution core, starts synchronous task processing at time t121 after the sensor phase reaches 90 degrees. Thereafter, the switching process is executed by the core C0 at a time t126 after the time t121. The synchronous task execution core is switched from the core C1 to the core C2.

時刻t126の後、センサ位相が120度になったときには、コアC1は非実行状態になっている。このため、時刻t141において、コアC1は同期タスクの処理を開始しない。   When the sensor phase becomes 120 degrees after time t126, the core C1 is in a non-execution state. For this reason, at time t141, the core C1 does not start the process of the synchronization task.

コアC2は、時刻t126よりも前においては同期タスク実行コアではなく、非実行状態となっている。このため、センサ位相が90度となっても、コアC2は同期タスクの処理を開始しない。   The core C2 is not a synchronous task execution core but is in a non-execution state before time t126. For this reason, even if the sensor phase becomes 90 degrees, the core C2 does not start the processing of the synchronization task.

コアC0により切り替え処理が実行された時刻t126の後、センサ位相が120度になったときには、コアC2は実行状態になっている。このため、コアC2は、120度のセンサ位相に対応した同期タスクの処理を開始する(時刻t131)。   After the time t126 when the switching process is executed by the core C0, when the sensor phase becomes 120 degrees, the core C2 is in the execution state. For this reason, the core C2 starts processing of the synchronization task corresponding to the sensor phase of 120 degrees (time t131).

以上のように、コアC0による切り替え処理が時刻t126において実行されると、90度のセンサ位相に対応した同期タスクはコアC1のみで行われ、120度のセンサ位相に対応した同期タスクはコアC2のみで行われる。その結果、切り替え処理が行われなかった場合と同様に、電子制御装置10による内燃機関20の制御は正常に行われる。   As described above, when the switching process by the core C0 is executed at the time t126, the synchronization task corresponding to the sensor phase of 90 degrees is performed only by the core C1, and the synchronization task corresponding to the sensor phase of 120 degrees is the core C2. Only done. As a result, similarly to the case where the switching process is not performed, the control of the internal combustion engine 20 by the electronic control device 10 is normally performed.

図13を参照しながら、他の例について説明する。図13の例では、切り替え処理が行われるタイミングが、時刻t131よりも後であり、且つ時刻t141よりも前の時刻t136となっている点において、図12の例と異なっている。   Another example will be described with reference to FIG. The example of FIG. 13 is different from the example of FIG. 12 in that the timing at which the switching process is performed is a time t136 after the time t131 and before the time t141.

この例でも、90度のセンサ位相に対応した同期タスクの処理はコアC1で開始され(時刻t121)、コアC2では開始されない(時刻t111)。   Also in this example, the processing of the synchronization task corresponding to the sensor phase of 90 degrees is started at the core C1 (time t121) and is not started at the core C2 (time t111).

時刻t131になると、この時点ではコアC2は未だ同期タスク実行コアではなく、非実行状態なのであるから、コアC2は120度のセンサ位相に対応した同期タスクの処理を開始しない。   At time t131, since the core C2 is not yet a synchronous task execution core at this time and is in a non-execution state, the core C2 does not start the synchronous task processing corresponding to the sensor phase of 120 degrees.

時刻t136よりも後の時刻t141になると、この時点ではコアC1は同期タスク実行コアではなくなっており、非実行状態となっている。このため、コアC1は、120度のセンサ位相に対応した同期タスクの処理を開始しない。   At time t141 after time t136, the core C1 is no longer a synchronous task execution core at this time, and is in a non-execution state. For this reason, the core C1 does not start the process of the synchronous task corresponding to the sensor phase of 120 degrees.

その結果、120度のセンサ位相に対応した同期タスクの処理は、コアC1とコアC2のいずれにおいても開始されないことになる。この場合、内燃機関20に対する駆動信号の送信が行われないので、やはり内燃機関20の制御において何らかの不具合が生じてしまう可能性がある。   As a result, the process of the synchronization task corresponding to the sensor phase of 120 degrees is not started in either the core C1 or the core C2. In this case, since a drive signal is not transmitted to the internal combustion engine 20, there is a possibility that some trouble may occur in the control of the internal combustion engine 20.

このように、従来の電子制御装置においては、切り替え処理が行われるタイミングによっては、同期タスクの一部が処理されない場合が生じ得る。以下では、このような現象を「処理の抜け」とも称する。   As described above, in the conventional electronic control apparatus, a part of the synchronization task may not be processed depending on the timing at which the switching process is performed. Hereinafter, such a phenomenon is also referred to as “processing omission”.

以上に説明した処理の重複、及び処理の抜けは、センサ位相が特定の位相となった際、それに対応した同期タスクの処理が開始されるタイミングがコア間で異なること、及び、切り替え処理が行われるタイミングが特に定められておらず、同期タスクの開始タイミング等とは非同期に切り替え処理が行われてしまうことに起因する。   As described above, the process overlap and the process omission are that when the sensor phase becomes a specific phase, the timing at which the corresponding synchronous task process starts is different between the cores, and the switching process is performed. This is because the switching process is performed asynchronously with the start timing of the synchronous task and the like.

本発明は、処理の重複及び処理の抜けを確実に防止しながら、切り替え処理を行うことを可能にするものである。図2及び図3を参照しながら、本実施形態における切り替え処理の概要について説明する。   The present invention makes it possible to perform a switching process while reliably preventing process overlap and process omission. An overview of the switching process in the present embodiment will be described with reference to FIGS.

図2は、電子制御装置10で実行される切り替え処理の流れを示すタイムチャートである。尚、当該タイムチャートの上段部分には、RAM130の状態が模式的に示されている。   FIG. 2 is a time chart showing the flow of the switching process executed by the electronic control device 10. The state of the RAM 130 is schematically shown in the upper part of the time chart.

本実施形態において同期タスクが実行されるタイミングは、図10乃至図13を参照しながら説明した比較例におけるタイミングと同一である。すなわち、本実施形態においても、センサ位相が60度、90度、120度、150度と、30度増加する毎に、同期タスク実行コアにおいて同期タスクが実行される。   The timing at which the synchronization task is executed in this embodiment is the same as the timing in the comparative example described with reference to FIGS. That is, also in the present embodiment, every time the sensor phase increases by 60 degrees, 90 degrees, 120 degrees, 150 degrees, or 30 degrees, the synchronous task is executed in the synchronous task execution core.

図2には、時刻t35において切り替え処理が実行され、同期タスク実行コアがコアC1からコアC2へと切り替えられる例が示されている。時刻t35よりも前において同期タスク実行コアであるコアC1は、センサ位相が90度となった後の時刻t10において、同期タスクの処理を開始する。センサ位相が90度となったタイミングと、同期タスクの処理が開始されるタイミングとは必ずしも一致しない。その理由は、比較例の説明において既に述べたとおりである。   FIG. 2 shows an example in which the switching process is executed at time t35 and the synchronous task execution core is switched from the core C1 to the core C2. Prior to time t35, the core C1, which is a synchronous task execution core, starts processing of the synchronous task at time t10 after the sensor phase reaches 90 degrees. The timing at which the sensor phase reaches 90 degrees does not necessarily coincide with the timing at which the synchronization task processing is started. The reason is as already described in the description of the comparative example.

RAM130の第1記憶部131には、同期タスク実行コアを示す数値(コア番号)が記憶されている。図2の例の場合、時刻t35よりも前の期間においては、第1記憶部131にはコアC1を示す数値である「1」が記憶されている。時刻t35よりも後の期間においては、第1記憶部131にはコアC2を示す数値である「2」が記憶されている。   The first storage unit 131 of the RAM 130 stores a numerical value (core number) indicating a synchronous task execution core. In the case of the example in FIG. 2, “1”, which is a numerical value indicating the core C <b> 1, is stored in the first storage unit 131 in the period before time t <b> 35. In a period after the time t35, the first storage unit 131 stores “2” that is a numerical value indicating the core C2.

時刻t10の後、センサ位相が90度から120度に変化すると、120度に対応した同期タスクの処理がコアC1により開始される(時刻t30)。図2の例では、切り替え処理が行われる時刻t35は、コアC1が同期タスクの処理を開始する時刻t30よりも後となっている。   When the sensor phase changes from 90 degrees to 120 degrees after time t10, the processing of the synchronization task corresponding to 120 degrees is started by the core C1 (time t30). In the example of FIG. 2, the time t35 when the switching process is performed is after the time t30 when the core C1 starts the process of the synchronization task.

本実施形態における切り替え処理は、コアC0が、第1記憶部131に記憶されているコア番号を書き換えることによって行われる。例えば、同期タスク実行コアをコアC1からコアC2に変更する場合には、第1記憶部131に記憶されているコア番号は1から2へと書き換えられる。   The switching process in the present embodiment is performed by the core C0 rewriting the core number stored in the first storage unit 131. For example, when the synchronous task execution core is changed from the core C1 to the core C2, the core number stored in the first storage unit 131 is rewritten from 1 to 2.

また、コアC0は、第1記憶部131に記憶されているコア番号を書き換えると同時に、第2記憶部132に記憶されている切り替え位相をも書き換える。「切り替え位相」とは、各コアの状態(実行状態、又は非実行状態)が切り替えられるべきタイミングを示す位相のことである。つまり、同期タスク実行コアの切り替え(変更)は、切り替え処理が実行されたタイミングである時刻t35において行われるのではなく、センサ位相が、第2記憶部132に記憶されている切り替え位相と一致したときに行われる。   Further, the core C0 rewrites the switching number stored in the second storage unit 132 at the same time as rewriting the core number stored in the first storage unit 131. The “switching phase” is a phase indicating the timing at which the state (execution state or non-execution state) of each core is to be switched. That is, the switching (change) of the synchronous task execution core is not performed at the time t35 when the switching process is executed, but the sensor phase matches the switching phase stored in the second storage unit 132. Sometimes done.

図2の例では、時刻t35において、第1記憶部131に記憶されているコア番号は1から2へと書き換えられる。また、第2記憶部132に記憶されている切り替え位相の値は150度に書き換えられる。   In the example of FIG. 2, the core number stored in the first storage unit 131 is rewritten from 1 to 2 at time t <b> 35. Further, the value of the switching phase stored in the second storage unit 132 is rewritten to 150 degrees.

本実施形態では、各コア(コアC1、コアC2)は、同期タスクの処理を行うに先立ち、第1記憶部131に記憶されているコア番号を参照する。また、第2記憶部132に記憶されている切り替え位相をも参照する。   In the present embodiment, each core (core C1, core C2) refers to the core number stored in the first storage unit 131 prior to performing the synchronization task processing. Further, the switching phase stored in the second storage unit 132 is also referred to.

このとき、読み込まれたコア番号が当該コアを示す数値であった場合には、当該コアは、センサ位相が切り替え位相と一致したときにのみ非実行状態から実行状態へと切り替わる。一方、読み込まれたコア番号が当該コアを示す数値でなかった場合には、当該コアは、センサ位相が切り替え位相と一致したときにのみ実行状態から非実行状態へと切り替わる。   At this time, if the read core number is a numerical value indicating the core, the core is switched from the non-execution state to the execution state only when the sensor phase matches the switching phase. On the other hand, when the read core number is not a numerical value indicating the core, the core switches from the execution state to the non-execution state only when the sensor phase matches the switching phase.

時刻t30においては、コアC0による切り替え処理が未だ行われておらず、第1記憶部131に記憶されているコア番号は1のままとなっている。このため、コアC1は時刻t30以降も実行状態のままであり、時刻t30において同期タスクの処理を開始する。   At time t30, the switching process by the core C0 has not yet been performed, and the core number stored in the first storage unit 131 remains at 1. For this reason, the core C1 remains in the execution state after the time t30, and starts the synchronous task processing at the time t30.

その後、時刻t35において切り替え処理が行われ、第1記憶部131のコア番号が書き換えられるのであるが、既にコアC1は同期タスクの処理を行っているので、当該処理は中断されることなくそのまま継続される。   Thereafter, the switching process is performed at time t35 and the core number of the first storage unit 131 is rewritten, but since the core C1 has already performed the synchronization task, the process continues without interruption. Is done.

時刻t35の後、センサ位相が150度になると、コアC1は再び第1記憶部131のコア番号、及び、第2記憶部132の切り替え位相を参照する(時刻t50)。時刻t50においては、第1記憶部131に記憶されているコア番号は2となっており、コアC1を示す数値(1)とは一致しない。   When the sensor phase becomes 150 degrees after time t35, the core C1 refers again to the core number of the first storage unit 131 and the switching phase of the second storage unit 132 (time t50). At time t50, the core number stored in the first storage unit 131 is 2, which does not match the numerical value (1) indicating the core C1.

また、第2記憶部132の切り替え位相は150度となっており、時刻t50におけるセンサ位相と一致している。このため、コアC1は、時刻t50において実行状態から非実行状態へと切り替わり、時刻t50では同期タスクの処理を開始しない。   Further, the switching phase of the second storage unit 132 is 150 degrees, which matches the sensor phase at time t50. For this reason, the core C1 switches from the execution state to the non-execution state at time t50, and does not start the synchronous task processing at time t50.

コアC2は、時刻t35よりも前においては同期タスク実行コアではなく、非実行状態となっている。このため、センサ位相が90度となっても、同期タスクの処理を開始しない。図2では、仮にコアC2が実行状態であるとしたときに、90度のセンサ位相に対応した同期タスクの実行がコアC2で開始される時刻を時刻t20として示している。   The core C2 is not a synchronous task execution core but is in a non-execution state before time t35. For this reason, even if the sensor phase is 90 degrees, the synchronization task processing is not started. In FIG. 2, when the core C2 is in an execution state, the time when the execution of the synchronous task corresponding to the sensor phase of 90 degrees is started in the core C2 is shown as time t20.

時刻t20よりも後の時刻t35において、コアC0により切り替え処理が実行される。センサ位相が120度になると、コアC2は第1記憶部131のコア番号、及び、第2記憶部132に記憶されている切り替え位相を参照する(時刻t40)。図2の例では、時刻t40は、切り替え処理が実行される時刻t35よりも後である。   At time t35 after time t20, the switching process is executed by the core C0. When the sensor phase reaches 120 degrees, the core C2 refers to the core number of the first storage unit 131 and the switching phase stored in the second storage unit 132 (time t40). In the example of FIG. 2, the time t40 is after the time t35 when the switching process is executed.

時刻t40においては、第1記憶部131に記憶されているコア番号は2となっており、コアC2に対応する番号と一致している。しかしながら、第2記憶部132に記憶されている切り替え位相は150度となっており、時刻t40におけるセンサ位相(120度)とは一致していない。このため、コアC2は、時刻t40においては実行状態に切り替わらず、時刻t40以降も非実行状態のままとなる。このため、このため、センサ位相が120度となっても、時刻t40においては同期タスクの処理を開始しない。   At time t40, the core number stored in the first storage unit 131 is 2, which matches the number corresponding to the core C2. However, the switching phase stored in the second storage unit 132 is 150 degrees and does not coincide with the sensor phase (120 degrees) at time t40. For this reason, the core C2 does not switch to the execution state at time t40, and remains in the non-execution state after time t40. For this reason, even if the sensor phase becomes 120 degrees, the synchronous task processing is not started at time t40.

時刻t40の後、センサ位相が150度になると、コアC2は再び第1記憶部131のコア番号、及び、第2記憶部132に記憶されている切り替え位相を参照する(時刻t60)。時刻t60においては、第1記憶部131に記憶されているコア番号は2となっており、コアC2を示す数値(2)と一致している。また、第2記憶部132に記憶されている切り替え位相は150度となっており、時刻t60におけるセンサ位相(150)と一致している。このため、コアC2は、時刻t60において非実行状態から実行状態へと切り替わり、時刻t60において同期タスクの処理を開始する。   When the sensor phase becomes 150 degrees after time t40, the core C2 refers to the core number of the first storage unit 131 and the switching phase stored in the second storage unit 132 again (time t60). At time t60, the core number stored in the first storage unit 131 is 2, which matches the numerical value (2) indicating the core C2. Further, the switching phase stored in the second storage unit 132 is 150 degrees, which coincides with the sensor phase (150) at time t60. For this reason, the core C2 switches from the non-execution state to the execution state at time t60, and starts synchronous task processing at time t60.

図2に示される例では、120度の位相に対応した同期タスクの処理をコアC1が開始する時刻t30と、120度の位相に対応した同期タスクの処理をコアC2が開始する時刻t40と、の間となる時刻t35において切り替え処理が実行されている。つまり、図11を参照しながら説明した比較例の場合と同様のタイミングにおいて、切り替え処理が実行されている。   In the example shown in FIG. 2, the time t30 when the core C1 starts processing of the synchronization task corresponding to the phase of 120 degrees, the time t40 when the core C2 starts the processing of the synchronization task corresponding to the phase of 120 degrees, Switching processing is executed at time t35, which is between. That is, the switching process is executed at the same timing as in the comparative example described with reference to FIG.

しかしながら、本実施形態においては、図11の場合のような処理の重複は生じておらず、120度に対応した同期タスクの処理はコアC1においてのみ開始されている。   However, in the present embodiment, there is no duplication of processing as in the case of FIG. 11, and the processing of the synchronization task corresponding to 120 degrees is started only in the core C1.

図3も、電子制御装置10で実行される切り替え処理の流れを示すタイムチャートである。図2の場合と同様に、当該タイムチャートの上段部分には、RAM130の状態が模式的に示されている。   FIG. 3 is also a time chart showing the flow of switching processing executed by the electronic control device 10. As in the case of FIG. 2, the state of the RAM 130 is schematically shown in the upper part of the time chart.

図3には、時刻t16において切り替え処理が実行され、同期タスク実行コアがコアC1からコアC2へと切り替えられる例が示されている。時刻t16において、第1記憶部131に記憶されているコア番号は1から2へと書き換えられる。また、第2記憶部132に記憶されている切り替え位相は120度に書き換えられる。   FIG. 3 shows an example in which the switching process is executed at time t16 and the synchronous task execution core is switched from the core C1 to the core C2. At time t16, the core number stored in the first storage unit 131 is rewritten from 1 to 2. The switching phase stored in the second storage unit 132 is rewritten to 120 degrees.

図3では、90度のセンサ位相に対応した同期タスクの処理がコアC1で開始される時刻が、時刻t21として示されている。また、仮にコアC2が実行状態であるとしたときに、90度のセンサ位相に対応した同期タスクの実行がコアC2で開始される時刻が、時刻t11として示されている。図3の例では、時刻t21が時刻t11よりも後の時刻となっている。また、切り替え処理が実行される時刻t16は、時刻t11よりも後であり、且つ時刻t21よりも前である。   In FIG. 3, the time at which the processing of the synchronous task corresponding to the sensor phase of 90 degrees is started at the core C1 is shown as time t21. Further, when the core C2 is in the execution state, the time when the execution of the synchronous task corresponding to the sensor phase of 90 degrees is started in the core C2 is indicated as time t11. In the example of FIG. 3, the time t21 is a time later than the time t11. The time t16 when the switching process is executed is after the time t11 and before the time t21.

同様に、図3では、120度のセンサ位相に対応した同期タスクの処理がコアC2で開始される時刻が、時刻t31として示されている。また、仮にコアC1が実行状態であるとしたときに、120度のセンサ位相に対応した同期タスクの実行がコアC1で開始される時刻が、時刻t41として示されている。図3の例では、時刻t41が時刻t31よりも後の時刻となっている。   Similarly, in FIG. 3, the time at which the processing of the synchronization task corresponding to the sensor phase of 120 degrees is started at the core C2 is shown as time t31. Further, when the core C1 is in the execution state, the time when the execution of the synchronous task corresponding to the sensor phase of 120 degrees is started in the core C1 is indicated as time t41. In the example of FIG. 3, time t41 is later than time t31.

センサ位相が90度となると、コアC1は、第1記憶部131のコア番号、及び、第2記憶部132に記憶されている切り替え位相を参照する(時刻t21)。   When the sensor phase reaches 90 degrees, the core C1 refers to the core number of the first storage unit 131 and the switching phase stored in the second storage unit 132 (time t21).

時刻t21においては、第1記憶部131に記憶されているコア番号は2となっており、コアC1に対応する番号と一致していない。このため、コアC1は、今後は同期タスク実行コアではなくなり、実行状態から非実行状態に切り替わることとなる。   At time t21, the core number stored in the first storage unit 131 is 2, and does not match the number corresponding to the core C1. For this reason, the core C1 will no longer be a synchronous task execution core, and will switch from an execution state to a non-execution state.

しかしながら、このとき第2記憶部132に記憶されている切り替え位相は120度となっており、時刻t21におけるセンサ位相(90度)とは一致していない。このため、コアC1は、時刻t21の時点においては未だ非実行状態に切り替わらず、引き続き実行状態のままとなる。このため、このため、センサ位相が90度である時刻t21において、コアC1は同期タスクの処理を開始する。   However, at this time, the switching phase stored in the second storage unit 132 is 120 degrees, which does not coincide with the sensor phase (90 degrees) at time t21. For this reason, the core C1 does not yet switch to the non-execution state at the time t21 and continues to be in the execution state. For this reason, at time t21 when the sensor phase is 90 degrees, the core C1 starts processing of the synchronization task.

時刻t21の後、センサ位相が120度になると、コアC1は再び第1記憶部131のコア番号、及び、第2記憶部132の切り替え位相を参照する(時刻t41)。時刻t41においては、第1記憶部131に記憶されているコア番号は2となっており、コアC1を示す数値(1)とは一致しない。   When the sensor phase reaches 120 degrees after time t21, the core C1 refers to the core number of the first storage unit 131 and the switching phase of the second storage unit 132 again (time t41). At time t41, the core number stored in the first storage unit 131 is 2, which does not match the numerical value (1) indicating the core C1.

また、第2記憶部132の切り替え位相は120度となっており、時刻t41におけるセンサ位相と一致している。このため、コアC1は、時刻t41において実行状態から非実行状態へと切り替わり、時刻t41では同期タスクの処理を開始しない。   Further, the switching phase of the second storage unit 132 is 120 degrees, which coincides with the sensor phase at time t41. For this reason, the core C1 switches from the execution state to the non-execution state at time t41, and does not start the synchronous task processing at time t41.

時刻t11において、コアC2は、第1記憶部131のコア番号、及び、第2記憶部132に記憶されている切り替え位相を参照する。時刻t11においては、第1記憶部131に記憶されているコア番号は1となっており、コアC2を示す数値(2)とは一致していない。このため、それまで非実行状態であったコアC2は、時刻t11以降も引き続き非実行状態のままとなる。コアC2は、時刻t11において同期タスクの処理を開始しない。   At time t11, the core C2 refers to the core number of the first storage unit 131 and the switching phase stored in the second storage unit 132. At time t11, the core number stored in the first storage unit 131 is 1, and does not match the numerical value (2) indicating the core C2. For this reason, the core C2 that has been in the non-execution state until then remains in the non-execution state even after time t11. The core C2 does not start the synchronization task processing at time t11.

センサ位相が120度になると、コアC2は、第1記憶部131のコア番号、及び、第2記憶部132に記憶されている切り替え位相を再び参照する(時刻t31)。時刻t31においては、第1記憶部131に記憶されているコア番号は2となっており、コアC2を示す数値(2)と一致している。   When the sensor phase reaches 120 degrees, the core C2 refers again to the core number of the first storage unit 131 and the switching phase stored in the second storage unit 132 (time t31). At time t31, the core number stored in the first storage unit 131 is 2, which matches the numerical value (2) indicating the core C2.

また、第2記憶部132の切り替え位相は120度となっており、時刻t31におけるセンサ位相と一致している。このため、コアC2は非実行状態から実行状態へと切り替わり、時刻t31において同期タスクの処理を開始する。   Further, the switching phase of the second storage unit 132 is 120 degrees, which coincides with the sensor phase at time t31. For this reason, the core C2 switches from the non-execution state to the execution state, and starts processing of the synchronous task at time t31.

図3に示される例では、90度の位相に対応した同期タスクの処理をコアC2が開始する時刻t11と、90度の位相に対応した同期タスクの処理をコアC1が開始する時刻t21と、の間となる時刻t16において切り替え処理が実行されている。つまり、図13を参照しながら説明した比較例の場合と同様のタイミングにおいて、切り替え処理が実行されている。   In the example shown in FIG. 3, the time t11 at which the core C2 starts the processing of the synchronization task corresponding to the phase of 90 degrees, the time t21 at which the core C1 starts the processing of the synchronization task corresponding to the phase of 90 degrees, The switching process is executed at time t16 between the two. That is, the switching process is executed at the same timing as in the comparative example described with reference to FIG.

しかしながら、本実施形態においては、図13の場合のような処理の抜けは生じておらず、90度に対応した同期タスクの処理はコアC1において開始されている。   However, in the present embodiment, the processing omission as in the case of FIG. 13 does not occur, and the processing of the synchronization task corresponding to 90 degrees is started in the core C1.

図4を参照しながら、電子制御装置10において実行される処理の具体的な内容について説明する。図4に示される一連の処理は、所定の周期が経過する毎に、マイコン100のコアC0において繰り返し実行されている。尚、当該処理は、コアC1又はコアC2のいずれかにおいて、同期タスク等の処理と並行して実行されていてもよい。   With reference to FIG. 4, the specific content of the process performed in the electronic control apparatus 10 is demonstrated. A series of processes shown in FIG. 4 is repeatedly executed in the core C0 of the microcomputer 100 every time a predetermined period elapses. The process may be executed in parallel with the process such as the synchronization task in either the core C1 or the core C2.

最初のステップS01では、切り替え処理の必要性が判断される。すなわち、コアC1及びコアC2において、処理負荷の偏りが生じていないかどうかが判断される。当該判定について、図5を参照しながら説明する。   In the first step S01, the necessity of the switching process is determined. That is, it is determined whether or not the processing load is uneven in the core C1 and the core C2. The determination will be described with reference to FIG.

図5には、内燃機関の20制御が電子制御装置10によって行われているときにおける、一つのコア(コアC1等)の処理負荷の例が示されている。具体的には、同期タスク以外の処理が行われた時間PT1、同期タスクの処理が行われた時間PT2、及び何ら処理が行われなかった空き時間DTのそれぞれについて、所定時間において各時間が占める割合の例が図示されている。   FIG. 5 shows an example of the processing load of one core (core C1 or the like) when 20 control of the internal combustion engine is performed by the electronic control unit 10. Specifically, the time PT1 when processing other than the synchronization task is performed, the time PT2 when processing of the synchronization task is performed, and the free time DT where no processing is performed occupy each time in a predetermined time. An example ratio is shown.

図5(A)の例では、時間PT1と時間PT2との和、すなわち、コアにおいて何らかの処理が行われていた時間の合計が比較的短くなっており、当該時間が所定時間において占める割合が閾値TH未満となっている。つまり、当該コアの処理負荷は比較的小さくなっており、当該コアでは、更なる処理を追加して行う余裕がある状態となっている。   In the example of FIG. 5A, the sum of the time PT1 and the time PT2, that is, the total time during which some processing is performed in the core is relatively short, and the ratio of the time in the predetermined time is a threshold value. It is less than TH. In other words, the processing load of the core is relatively small, and the core is in a state where there is room to perform additional processing.

一方、図5(B)の例では、時間PT1と時間PT2との和が、閾値THを超えている。つまり、当該コアの処理負荷は比較的大きくなっており、当該コアは処理能力の限界に近い状態となっている。   On the other hand, in the example of FIG. 5B, the sum of the time PT1 and the time PT2 exceeds the threshold value TH. That is, the processing load of the core is relatively large, and the core is in a state close to the limit of processing capacity.

図4に戻って説明を続ける。ステップS01では、時間PT1と時間PT2との和が所定時間において占める割合が、閾値THを超えている場合にのみ、切り替え処理が必要であると判定される。換言すれば、空き時間DTが所定期間において占める割合が、閾値(100%から閾値THを差し引いて得られた値)を下回った場合にのみ、切り替え処理が必要であると判定される。   Returning to FIG. 4, the description will be continued. In step S01, it is determined that the switching process is necessary only when the ratio of the sum of the time PT1 and the time PT2 to the predetermined time exceeds the threshold value TH. In other words, it is determined that the switching process is necessary only when the ratio of the idle time DT in the predetermined period falls below a threshold value (a value obtained by subtracting the threshold value TH from 100%).

一方、時間PT1と時間PT2との和が所定時間において占める割合が、閾値THを超えていない場合には、切り替え処理が不要であると判定される。換言すれば、空き時間DTが所定期間において占める割合が、閾値(100%から閾値THを差し引いて得られた値)を下回らない場合には、切り替え処理が不要であると判定される。   On the other hand, when the ratio of the sum of the time PT1 and the time PT2 in the predetermined time does not exceed the threshold value TH, it is determined that the switching process is unnecessary. In other words, when the ratio of the free time DT in the predetermined period does not fall below the threshold value (a value obtained by subtracting the threshold value TH from 100%), it is determined that the switching process is unnecessary.

ステップS01において、切り替え処理が不要であると判定された場合には、図4に示される一連の処理を終了する。一方、切り替え処理が必要であると判定された場合には、ステップS02に移行する。ステップS02では、切り替え処理後において同期タスクを実行するコアのコア番号(実行コア番号)が決定される。   If it is determined in step S01 that the switching process is not necessary, the series of processes shown in FIG. 4 is terminated. On the other hand, when it is determined that the switching process is necessary, the process proceeds to step S02. In step S02, the core number (execution core number) of the core that executes the synchronization task after the switching process is determined.

切り替え処理後の新たな実行コア番号を決定する方法について、図6及び図7を参照しながら説明する。図6及び図7には、内燃機関の20制御が電子制御装置10によって行われているときにおける、コアC1及びコアC2のそれぞれの処理負荷の例が示されている。図6及び図7においても、図5と同様に、同期タスク以外の処理が行われた時間PT1、同期タスクの処理が行われた時間PT2、何ら処理が行われなかった空き時間DTのそれぞれについて、所定時間において各時間が占める割合の例が図示されている。   A method for determining a new execution core number after the switching process will be described with reference to FIGS. 6 and 7 show examples of the processing loads of the core C1 and the core C2 when 20 control of the internal combustion engine is performed by the electronic control unit 10. FIG. 6 and 7, as in FIG. 5, each of the time PT1 when processing other than the synchronization task is performed, the time PT2 when processing of the synchronization task is performed, and the free time DT where no processing is performed. The example of the ratio which each time occupies in predetermined time is shown in figure.

図6及び図7例では、コアC1が同期タスク実行コアとなっている。このため、コアC1については、時間PT1、時間PT2、及び空き時間DTがそれぞれ存在している。一方、コアC2は同期タスク実行コアではないので、コアC2については、同期タスクの処理が行われた時間PT2は存在しない。   6 and 7, the core C1 is a synchronous task execution core. For this reason, time PT1, time PT2, and idle time DT exist for the core C1. On the other hand, since the core C2 is not a synchronous task execution core, there is no time PT2 when the processing of the synchronous task is performed for the core C2.

ここで、前記所定時間あたりにおける時間PT2と空き時間DTとの和を「合算時間」と定義する。コアC1についての合算時間T1は、時間PT2と空き時間DTとの和となる。一方、コアC2についての合算時間T2は、(時間PT2が存在しないので)空き時間DTと同じである。図6の例では、コアC2における合算時間T2の方が、コアC1における合算時間T1よりも長くなっている。   Here, the sum of the time PT2 and the idle time DT per the predetermined time is defined as “total time”. The total time T1 for the core C1 is the sum of the time PT2 and the free time DT. On the other hand, the total time T2 for the core C2 is the same as the idle time DT (since there is no time PT2). In the example of FIG. 6, the total time T2 in the core C2 is longer than the total time T1 in the core C1.

図4に戻って説明を続ける。ステップS02では、各コア(C1、C2)における合算時間(T1、T2)をそれぞれ算出した上で、それらのうち最も長いものに対応するコア(図6の例ではコアC2)を示すコア番号が、新たな実行コア番号とされる。   Returning to FIG. 4, the description will be continued. In step S02, after calculating the total time (T1, T2) in each of the cores (C1, C2), the core number indicating the core (core C2 in the example of FIG. 6) corresponding to the longest of them is obtained. , A new execution core number.

つまり、切り替え処理後における同期タスク実行コアの空き時間DTが、切り替え処理前における同期タスク実行コアの空き時間DTよりも長くなるように、新たな実行コア番号が決定される。   That is, the new execution core number is determined such that the free time DT of the synchronous task execution core after the switching process is longer than the free time DT of the synchronous task execution core before the switching process.

尚、図7に示される例のように、合算時間T1の方が合算時間T2よりも長いような場合には、最も長い合算時間に対応するコアは、同期タスク実行コアであるコアC1ということになる。この場合、実行コア番号は変化せずに1のままとなる。このように、実行コア番号が変化すると、同期タスク実行コアの空き時間DTが短くなってしまうような場合には、実行コア番号は変化しない。   If the total time T1 is longer than the total time T2 as in the example shown in FIG. 7, the core corresponding to the longest total time is the core C1 that is a synchronous task execution core. become. In this case, the execution core number remains unchanged at 1. As described above, when the execution core number changes, the execution core number does not change when the idle time DT of the synchronous task execution core becomes short.

ステップS02に続くステップS03では、実行コア番号が変化するか否かが判定される。すなわち、ステップS02で決定された実行コア番号が、切り替え処理が行われる前における同期タスク実行コアのコア番号とは異なるか否かが判定される。   In step S03 following step S02, it is determined whether or not the execution core number changes. That is, it is determined whether or not the execution core number determined in step S02 is different from the core number of the synchronous task execution core before the switching process is performed.

実行コア番号が変化しない場合には、切り替え処理は不要ということであるから、図4に示される一連の処理を終了する。実行コア番号が変化する場合には、ステップS04に移行する。   If the execution core number does not change, it means that the switching process is unnecessary, and thus the series of processes shown in FIG. 4 is terminated. When the execution core number changes, the process proceeds to step S04.

ステップS04では、切り替え位相が決定される。切り替え位相は、図4の処理が行われている時点の位相に基づいて決定される。具体的には、当該時点におけるセンサ位相(例えば90度)の次に回転同期タスクが実行される位相(この場合は120度)が、切り替え位相として決定される。   In step S04, the switching phase is determined. The switching phase is determined based on the phase at the time when the processing of FIG. 4 is performed. Specifically, the phase (120 degrees in this case) in which the rotation synchronization task is executed next to the sensor phase (for example, 90 degrees) at the time point is determined as the switching phase.

切り替え位相(Pn)を上記のように決定するための式の例としては、以下の式(1)が挙げられる。
Pn=(((Pc/30)+1)%24)×30・・・(1)
上記の式(1)において、Pcは現時点におけるセンサ位相である。また、「/」は商を算出するための演算子であり、「%」は剰余を算出するための演算子である。
As an example of an equation for determining the switching phase (Pn) as described above, the following equation (1) is given.
Pn = ((((Pc / 30) +1)% 24) × 30 (1)
In the above equation (1), Pc is the current sensor phase. “/” Is an operator for calculating a quotient, and “%” is an operator for calculating a remainder.

尚、切り替え位相を決定するための方法は、上記のようなものに限られない。例えば、現時点におけるセンサ位相(例えば90度)の次の次に回転同期タスクが実行される位相(この場合は150度)が、切り替え位相として決定されてもよい。   Note that the method for determining the switching phase is not limited to the above. For example, the phase (in this case, 150 degrees) in which the rotation synchronization task is executed next to the sensor phase (for example, 90 degrees) at the current time may be determined as the switching phase.

ステップS04に続くステップS05では、ステップS04で決定された切り替え位相が第2記憶部132に書き込まれる。また、ステップS05に続くステップS06では、ステップS02で決定された実行コア番号が第1記憶部131に書き込まれる。   In step S05 following step S04, the switching phase determined in step S04 is written in the second storage unit 132. In step S06 following step S05, the execution core number determined in step S02 is written into the first storage unit 131.

図8を参照しながら、コアC1及びコアC2で実行される処理の流れについて説明する。図8に示される処理は、コアC1及びコアC2のそれぞれにおいて、センサ位相が30度変化する毎に繰り返し実行される。尚、センサ位相が30度変化したタイミング(90度等となったタイミング)と、図8の処理が開始されるタイミングとは、必ずしも一致しない。その理由は、比較例の説明等において既に述べたとおりである。   The flow of processing executed by the core C1 and the core C2 will be described with reference to FIG. The process shown in FIG. 8 is repeatedly executed every time the sensor phase changes by 30 degrees in each of the core C1 and the core C2. Note that the timing at which the sensor phase changes by 30 degrees (the timing at which the sensor phase becomes 90 degrees, etc.) does not necessarily coincide with the timing at which the processing of FIG. 8 is started. The reason is as already described in the description of the comparative example.

最初のステップS11では、第1記憶部131に記憶されているコア番号(実行コア番号)を読み出す。続くステップS12では、第2記憶部132に記憶されている切り替え位相を読み出す。   In the first step S11, the core number (execution core number) stored in the first storage unit 131 is read. In the subsequent step S12, the switching phase stored in the second storage unit 132 is read out.

ステップS12に続くステップS13では、読み出された実行コア番号と切り替え位相、及び、現時点におけるコアの状態(実行状態又は非実行状態)に基づいて、今後の状態(実行状態又は非実行状態)を決定し切り替える。   In step S13 following step S12, the future state (execution state or non-execution state) is determined based on the read execution core number and switching phase and the current core state (execution state or non-execution state). Determine and switch.

既に述べたように、本実施形態においては、第1記憶部131の実行コア番号が当該コアを示す数値であった場合には、当該コアは、センサ位相が第2記憶部132の切り替え位相と一致したときにのみ非実行状態から実行状態へと切り替わる。一方、第1記憶部131のコア番号が当該コアを示す数値でなかった場合には、当該コアは、センサ位相が第2記憶部132の切り替え位相と一致したときにのみ実行状態から非実行状態へと切り替わる。   As already described, in this embodiment, when the execution core number of the first storage unit 131 is a numerical value indicating the core, the core has the sensor phase as the switching phase of the second storage unit 132. Only when they match, the non-execution state switches to the execution state. On the other hand, when the core number of the first storage unit 131 is not a numerical value indicating the core, the core is changed from the execution state to the non-execution state only when the sensor phase matches the switching phase of the second storage unit 132. Switch to.

状態の切り替えを以上のように行うための、ステップS13における具体的な決定方法について、図9を参照しながら説明する。図9は、コアC1及びコアC2のそれぞれについての状態遷移図である。   A specific determination method in step S13 for performing state switching as described above will be described with reference to FIG. FIG. 9 is a state transition diagram for each of the core C1 and the core C2.

コアC1を例にとって説明する。例えば、図3における時刻t16より前のように、初回の切り替え処理が行われるよりも前の初期状態においては、コアC1は実行状態(ST1)となっている。   A description will be given taking the core C1 as an example. For example, the core C1 is in the execution state (ST1) in the initial state before the first switching process is performed as before the time t16 in FIG.

センサ位相が変化して同期タスクが実行されるべきタイミングにおいて、実行状態であるコアC1は、以下の条件Bが満たされているか否かを判定する。   At the timing when the sensor phase changes and the synchronization task is to be executed, the core C1 in the execution state determines whether or not the following condition B is satisfied.

条件Bとは、読み出された実行コア番号が、当該コア(この例ではコアC1)を示すコア番号と一致しておらず、且つ、読み出された切り替え位相が、現時点におけるセンサ位相と一致していること、である。   Condition B is that the read execution core number does not match the core number indicating the core (in this example, core C1), and the read switching phase is the same as the current sensor phase. What you are doing.

コアC1は、このような条件Bが満たされている場合にのみ、実行状態(ST1)から非実行状態(ST2)へと切り替わる。例えば、図3の時刻t21においては、読み出された実行コア番号(2)は、コアC1を示すコア番号(1)と一致していないので、条件Bの前半部分を満たしている。しかしながら、読み出された切り替え位相(120)は、時刻t21におけるセンサ位相(90度)と一致していないので、条件Bの後半部分を満たしていない。このため、時刻t21の時点では、実行状態(ST1)から非実行状態(ST2)へは切り替わらない。   Only when the condition B is satisfied, the core C1 switches from the execution state (ST1) to the non-execution state (ST2). For example, at time t21 in FIG. 3, the read execution core number (2) does not match the core number (1) indicating the core C1, and therefore satisfies the first half of the condition B. However, since the read switching phase (120) does not match the sensor phase (90 degrees) at time t21, the latter half of the condition B is not satisfied. For this reason, at the time t21, the execution state (ST1) is not switched to the non-execution state (ST2).

コアC1が非実行状態となった後、同期タスクが再び実行されるべきタイミングになると、コアC1は、以下の条件Aが満たされているか否かを判定する。   After the core C1 enters the non-execution state, the core C1 determines whether or not the following condition A is satisfied when it is time to execute the synchronization task again.

条件Aとは、読み出された実行コア番号が、当該コア(この例ではコアC1)を示すコア番号と一致しており、且つ、読み出された切り替え位相が、現時点におけるセンサ位相と一致していること、である。   Condition A is that the read execution core number matches the core number indicating the core (core C1 in this example), and the read switching phase matches the current sensor phase. It is that.

コアC1は、このような条件Aが満たされている場合にのみ、非実行状態(ST2)から実行状態(ST1)へと切り替わる。   The core C1 switches from the non-execution state (ST2) to the execution state (ST1) only when such a condition A is satisfied.

コアC2についても上記と同様である。例えば、図2における時刻t35より前のように、初回の切り替え処理が行われるよりも前の初期状態においては、コアC2は非実行状態(ST2)となっている。   The same applies to the core C2. For example, the core C2 is in the non-execution state (ST2) in the initial state before the first switching process is performed as before the time t35 in FIG.

センサ位相が変化して同期タスクが実行されるべきタイミングにおいて、非実行状態であるコアC2は、上記の条件Aが満たされているか否かを判定する。コアC2は、条件Aが満たされている場合にのみ、非実行状態(ST2)から実行状態(ST1)へと切り替わる。例えば、図2の時刻t40においては、読み出された実行コア番号(2)は、コアC2を示すコア番号(2)と一致しているので、条件Aの前半部分を満たしている。しかしながら、読み出された切り替え位相(150)は、時刻t40におけるセンサ位相(120度)と一致していないので、条件Aの後半部分を満たしていない。このため、時刻t40の時点では、非実行状態(ST2)から実行状態(ST1)へは切り替わらない   At the timing when the sensor phase changes and the synchronization task is to be executed, the core C2 that is in the non-execution state determines whether or not the above condition A is satisfied. The core C2 switches from the non-execution state (ST2) to the execution state (ST1) only when the condition A is satisfied. For example, at time t40 in FIG. 2, the read execution core number (2) matches the core number (2) indicating the core C2, so the first half of the condition A is satisfied. However, since the read switching phase (150) does not coincide with the sensor phase (120 degrees) at time t40, the latter half of the condition A is not satisfied. For this reason, at time t40, the non-execution state (ST2) is not switched to the execution state (ST1).

コアC2が非実行状態となった後、同期タスクが再び実行されるべきタイミングになると、コアC2は条件Bが満たされているか否かを判定する。コアC2は、条件Bが満たされている場合にのみ、実行状態(ST1)から非実行状態(ST2)へと切り替わる。   After the core C2 enters the non-execution state, when it is time to execute the synchronization task again, the core C2 determines whether the condition B is satisfied. The core C2 switches from the execution state (ST1) to the non-execution state (ST2) only when the condition B is satisfied.

図8に戻って説明を続ける。ステップS13に続くステップS14では、ステップS13の結果、当該セルが実行状態となったかどうかが判定される。実行状態となっていれば、同期タスクの実行を行う(ステップS15)。実行状態となっていなければ、同期タスクの実行を行うことなく、図8に示される処理を終了する。   Returning to FIG. In step S14 following step S13, it is determined whether or not the cell is in an execution state as a result of step S13. If it is in the execution state, the synchronous task is executed (step S15). If not in the execution state, the process shown in FIG. 8 is terminated without executing the synchronization task.

以上、具体例を参照しつつ本発明の実施の形態について説明した。しかし、本発明はこれらの具体例に限定されるものではない。すなわち、これら具体例に、当業者が適宜設計変更を加えたものも、本発明の特徴を備えている限り、本発明の範囲に包含される。例えば、前述した各具体例が備える各要素およびその配置、材料、条件、形状、サイズなどは、例示したものに限定されるわけではなく適宜変更することができる。また、前述した各実施の形態が備える各要素は、技術的に可能な限りにおいて組み合わせることができ、これらを組み合わせたものも本発明の特徴を含む限り本発明の範囲に包含される。   The embodiments of the present invention have been described above with reference to specific examples. However, the present invention is not limited to these specific examples. In other words, those specific examples that have been appropriately modified by those skilled in the art are also included in the scope of the present invention as long as they have the characteristics of the present invention. For example, the elements included in each of the specific examples described above and their arrangement, materials, conditions, shapes, sizes, and the like are not limited to those illustrated, but can be changed as appropriate. Moreover, each element with which each embodiment mentioned above is provided can be combined as long as technically possible, and the combination of these is also included in the scope of the present invention as long as it includes the features of the present invention.

10:電子制御装置
11:入力回路
12:出力回路
20:内燃機関
100:マイコン
C0,C1,C2:コア
131:第1記憶部
132:第2記憶部
10: Electronic control unit 11: Input circuit 12: Output circuit 20: Internal combustion engine 100: Microcomputer C0, C1, C2: Core 131: First storage unit 132: Second storage unit

Claims (9)

複数のコア(C0,C1,C2)を搭載したマルチコアマイクロコンピュータ(100)を備えており、前記コアにおいて、回転角の位相に同期してタスクを実行する電子制御装置(10)であって、
前記タスクを実行するタスク実行コア、を示すコア番号を記憶する第1記憶部(131)と、
前記タスク実行コアの切り替えが行われる際の位相、を示す切り替え位相を記憶する第2記憶部(132)と、を備え、
前記第1記憶部に記憶されている前記コア番号、及び、前記第2記憶部に記憶されている前記切り替え位相に基づいて、前記タスク実行コアの切り替えを行うことを特徴とする電子制御装置。
An electronic control device (10) comprising a multi-core microcomputer (100) equipped with a plurality of cores (C0, C1, C2), and executing a task in synchronization with the phase of the rotation angle in the core,
A first storage unit (131) for storing a core number indicating a task execution core for executing the task;
A second storage unit (132) for storing a switching phase indicating a phase when the task execution core is switched,
The electronic control device, wherein the task execution core is switched based on the core number stored in the first storage unit and the switching phase stored in the second storage unit.
それぞれの前記コアは、
前記第1記憶部に記憶されている前記コア番号が、当該コアを示すものである場合には、
位相が、前記第2記憶部に記憶されている前記切り替え位相となったときに、前記タスク実行コアに切り替わるように構成されていることを特徴とする、請求項1に記載の電子制御装置。
Each said core is
When the core number stored in the first storage unit indicates the core,
The electronic control device according to claim 1, wherein the electronic control device is configured to switch to the task execution core when the phase becomes the switching phase stored in the second storage unit.
前記第2記憶部に記憶されている前記切り替え位相は、当該切り替え位相が決定される時点の位相、に基づいて決定されたものであることを特徴とする、請求項2に記載の電子制御装置。   The electronic control device according to claim 2, wherein the switching phase stored in the second storage unit is determined based on a phase at a time when the switching phase is determined. . 前記第2記憶部に記憶されている前記切り替え位相は、当該切り替え位相が決定される時点の位相、よりも後の位相であることを特徴とする、請求項3に記載の電子制御装置。   The electronic control device according to claim 3, wherein the switching phase stored in the second storage unit is a phase after the phase at which the switching phase is determined. 前記第2記憶部に記憶されている前記切り替え位相は、当該切り替え位相が決定される時点の位相、の次に、前記タスクが実行される位相であることを特徴とする、請求項4に記載の電子制御装置。   The switching phase stored in the second storage unit is a phase in which the task is executed next to a phase at a time when the switching phase is determined. Electronic control unit. 前記第1記憶部に記憶されている前記コア番号は、それぞれの前記コアの、所定時間における演算処理負荷に基づいて決定されたものであることを特徴とする、請求項1に記載の電子制御装置。   The electronic control according to claim 1, wherein the core number stored in the first storage unit is determined based on an arithmetic processing load of each of the cores at a predetermined time. apparatus. 前記タスク実行コアの切り替えは、
前記所定時間における前記タスク実行コアの処理の空き時間の合計が、閾値を下回ったときにのみ行われることを特徴とする、請求項6に記載の電子制御装置。
The task execution core switching is as follows.
The electronic control device according to claim 6, wherein the electronic control device is performed only when the total idle time of processing of the task execution core in the predetermined time is below a threshold value.
それぞれの前記コアにおける前記演算処理負荷は、
前記所定時間のうち、当該コアで前記タスクが実行される時間の合計である第1時間と、
前記所定時間のうち、当該コアの処理の空き時間の合計である第2時間と、に基づいて算出されることを特徴とする、請求項6又は7に記載の電子制御装置。
The calculation processing load in each of the cores is
Of the predetermined time, a first time that is a total time for the task to be executed in the core;
The electronic control device according to claim 6, wherein the electronic control device is calculated based on a second time that is a total of idle times of processing of the core among the predetermined time.
それぞれの前記コアの性能は互いに同一であって、
前記タスク実行コアについて算出された前記第1時間と前記第2時間との和と、
前記タスク実行コア以外の前記コアについて算出された前記第2時間と、を比較し、
これらのうち最も長いものに対応する前記コアを示す前記コア番号が、前記第1記憶部に記憶されることを特徴とする、請求項8に記載の電子制御装置。
The performance of each of the cores is the same as each other,
The sum of the first time and the second time calculated for the task execution core;
Comparing the second time calculated for the core other than the task execution core,
The electronic control device according to claim 8, wherein the core number indicating the core corresponding to the longest of these is stored in the first storage unit.
JP2015045426A 2015-03-09 2015-03-09 Electronic control unit Active JP6394442B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2015045426A JP6394442B2 (en) 2015-03-09 2015-03-09 Electronic control unit
DE102016203418.9A DE102016203418A1 (en) 2015-03-09 2016-03-02 ELECTRONIC CONTROL UNIT

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015045426A JP6394442B2 (en) 2015-03-09 2015-03-09 Electronic control unit

Publications (2)

Publication Number Publication Date
JP2016165912A true JP2016165912A (en) 2016-09-15
JP6394442B2 JP6394442B2 (en) 2018-09-26

Family

ID=56800694

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015045426A Active JP6394442B2 (en) 2015-03-09 2015-03-09 Electronic control unit

Country Status (2)

Country Link
JP (1) JP6394442B2 (en)
DE (1) DE102016203418A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7476638B2 (en) 2020-04-15 2024-05-01 株式会社デンソー Multiprocessor Systems

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010113419A (en) * 2008-11-04 2010-05-20 Toyota Motor Corp Multicore controller
US20100205602A1 (en) * 2004-12-16 2010-08-12 Vmware, Inc. Mechanism for Scheduling Execution of Threads for Fair Resource Allocation in a Multi-Threaded and/or Multi-Core Processing System
JP2010196619A (en) * 2009-02-26 2010-09-09 Toyota Motor Corp Control system of internal combustion engine
JP2012108786A (en) * 2010-11-18 2012-06-07 Toyota Motor Corp Microcomputer and processing synchronization method
JP2013130104A (en) * 2011-12-21 2013-07-04 Toyota Motor Corp Control device of internal combustion engine

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5776661B2 (en) 2012-10-09 2015-09-09 株式会社デンソー Electronic control unit

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205602A1 (en) * 2004-12-16 2010-08-12 Vmware, Inc. Mechanism for Scheduling Execution of Threads for Fair Resource Allocation in a Multi-Threaded and/or Multi-Core Processing System
JP2010113419A (en) * 2008-11-04 2010-05-20 Toyota Motor Corp Multicore controller
JP2010196619A (en) * 2009-02-26 2010-09-09 Toyota Motor Corp Control system of internal combustion engine
JP2012108786A (en) * 2010-11-18 2012-06-07 Toyota Motor Corp Microcomputer and processing synchronization method
JP2013130104A (en) * 2011-12-21 2013-07-04 Toyota Motor Corp Control device of internal combustion engine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7476638B2 (en) 2020-04-15 2024-05-01 株式会社デンソー Multiprocessor Systems

Also Published As

Publication number Publication date
DE102016203418A1 (en) 2016-09-15
JP6394442B2 (en) 2018-09-26

Similar Documents

Publication Publication Date Title
JP5818938B1 (en) Control device switching system
US10789184B2 (en) Vehicle control device
US11709697B2 (en) Vehicle control device, vehicle control method, and recording medium storing vehicle control program
JP6394442B2 (en) Electronic control unit
JP2012082693A (en) Engine control device
JP7147615B2 (en) task management device
JP5518021B2 (en) Information processing device
JP2016066139A (en) Vehicle control unit
JP4321472B2 (en) Control device
US11681601B2 (en) Application program management method and apparatus, and storage medium
JP2010113419A (en) Multicore controller
CN107710162B (en) Electronic control device and stack using method
JP2009093344A (en) Microcomputer, method of using the same, and electronic control unit
CN111480144B (en) Method for managing multiple tasks by multi-core motor vehicle computer
JP2014004858A (en) Vehicle control device
JP2016206817A (en) Electronic controller
JP6466269B2 (en) Electronic control device and stack area usage monitoring method
JP2018072921A (en) On-vehicle electronic control device
JP6447442B2 (en) Electronic control unit
JP2003345404A (en) Electronic control device and program
JP2020159344A (en) Control device and control method
JP7226064B2 (en) electronic controller
JP6877475B2 (en) Electronic control device and stack usage
JP2012247849A (en) Microcomputer
JP6493190B2 (en) Information processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170710

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180704

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180731

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180813

R151 Written notification of patent or utility model registration

Ref document number: 6394442

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250