JP2012108786A - Microcomputer and processing synchronization method - Google Patents
Microcomputer and processing synchronization method Download PDFInfo
- Publication number
- JP2012108786A JP2012108786A JP2010258047A JP2010258047A JP2012108786A JP 2012108786 A JP2012108786 A JP 2012108786A JP 2010258047 A JP2010258047 A JP 2010258047A JP 2010258047 A JP2010258047 A JP 2010258047A JP 2012108786 A JP2012108786 A JP 2012108786A
- Authority
- JP
- Japan
- Prior art keywords
- core
- processing
- predetermined information
- processing unit
- crank
- 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
Links
- 238000012545 processing Methods 0.000 title claims abstract description 187
- 238000000034 method Methods 0.000 title claims description 82
- 238000004891 communication Methods 0.000 claims abstract description 15
- 230000008569 process Effects 0.000 claims description 68
- 239000000446 fuel Substances 0.000 claims description 13
- 238000002347 injection Methods 0.000 claims description 9
- 239000007924 injection Substances 0.000 claims description 9
- 230000001960 triggered effect Effects 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 19
- 238000002485 combustion reaction Methods 0.000 description 10
- 238000001514 detection method Methods 0.000 description 9
- 230000008859 change Effects 0.000 description 5
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000630 rising effect Effects 0.000 description 4
- 102100024061 Integrator complex subunit 1 Human genes 0.000 description 3
- 101710092857 Integrator complex subunit 1 Proteins 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 230000033001 locomotion Effects 0.000 description 3
- 102100028043 Fibroblast growth factor 3 Human genes 0.000 description 2
- 108050002021 Integrator complex subunit 2 Proteins 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 101100325756 Arabidopsis thaliana BAM5 gene Proteins 0.000 description 1
- 102100031584 Cell division cycle-associated 7-like protein Human genes 0.000 description 1
- 101000777638 Homo sapiens Cell division cycle-associated 7-like protein Proteins 0.000 description 1
- 101150046378 RAM1 gene Proteins 0.000 description 1
- 101100476489 Rattus norvegicus Slc20a2 gene Proteins 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 239000000567 combustion gas Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 239000007789 gas Substances 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Landscapes
- Multi Processors (AREA)
- Bus Control (AREA)
- Electrical Control Of Ignition Timing (AREA)
- Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)
- Combined Controls Of Internal Combustion Engines (AREA)
- Debugging And Monitoring (AREA)
Abstract
【課題】一方のコアから他方のコアに割込みによりイベントを通知する際、イベントの誤通知を検知できるマイコンを提供すること。
【解決手段】第1のコア52と第2のコア53間で通信する通信手段43と、第1のコアと第2のコアが共有する共有メモリ51と、外部信号を取得して第1の処理を実行し、第1の処理毎に所定情報を共有メモリに書き込む第1の処理手段55と、通信手段を介して第2のコアに処理要求を出力する処理要求手段33と、処理要求をトリガーに第2の処理を実行する第2の処理手段56と、を有するマイコン100において、第2のコアは、処理要求を受け付けた場合、共有メモリから最新の所定情報と前回の所定情報を読み出し、最新の所定情報と前回の所定情報に規定された関係がある場合のみ、第2の処理手段に第2の処理の実行を許可する比較手段57、を有する。
【選択図】図2An object of the present invention is to provide a microcomputer capable of detecting an erroneous notification of an event when an event is notified from one core to the other core by an interrupt.
Communication means 43 for communicating between a first core 52 and a second core 53, a shared memory 51 shared by the first core and the second core, an external signal is acquired and the first A first processing unit 55 that executes processing and writes predetermined information to the shared memory for each first processing; a processing request unit 33 that outputs a processing request to the second core via the communication unit; In the microcomputer 100 having the second processing unit 56 that executes the second processing as a trigger, the second core reads the latest predetermined information and the previous predetermined information from the shared memory when receiving a processing request. Only when there is a relationship defined by the latest predetermined information and the previous predetermined information, the second processing means has a comparison means 57 that permits execution of the second processing.
[Selection] Figure 2
Description
本発明は、複数のコアが同期しながら処理を実行するマイコンに関し、特に、同期の誤検知を検出できるマイコンに関する。 The present invention relates to a microcomputer that executes processing while synchronizing a plurality of cores, and more particularly to a microcomputer that can detect erroneous detection of synchronization.
車両のエンジンは電子制御装置により種々の制御が行われている。例えば、燃焼室への燃料噴射タイミングの決定、イグナイタの点火タイミング、燃料噴射量の決定などは電子制御装置が演算やマップ引きなどにより行っている。このようなエンジン制御はクランク角に応じた適切なタイミングで行うことが好ましく、電子制御装置はNEセンサの信号の入力に基づきエンジン制御に付随する処理を開始する。 Various controls are performed on the vehicle engine by an electronic control unit. For example, the determination of the fuel injection timing to the combustion chamber, the ignition timing of the igniter, the determination of the fuel injection amount, and the like are performed by the electronic control device by calculation or map drawing. Such engine control is preferably performed at an appropriate timing according to the crank angle, and the electronic control device starts processing associated with engine control based on the input of a signal from the NE sensor.
ここで、電子制御装置においてもCPUのマルチコア化が図れるようになってきたため、エンジン制御に関する種々の制御を複数のコアで分担する技術が考案されている(例えば、特許文献1参照。)。特許文献1には、エンジン制御のための処理に関する割り込み要求をマスターコアがスレーブコアに対して行い、スレーブコアが割り込み要求に応じたエンジン制御のための処理を行えない場合、エンジン制御のための処理に関する優先度を高く設定するマルチコアプロセッサが開示されている。
Here, since it has become possible to make the CPU multi-core also in the electronic control device, a technique has been devised in which various controls related to engine control are shared by a plurality of cores (see, for example, Patent Document 1). In
このように、エンジン制御のための処理を複数のコアで分担する場合、コア同士が処理を同期できるように、一方のコアが他方のコアに処理のタイミングを割込みにより通知することがある。 As described above, when processing for engine control is shared by a plurality of cores, one core may notify the processing timing to the other core by an interrupt so that the cores can synchronize processing.
しかしながら、コア間の割込み要求を処理開始のタイミングとすると、割込みの誤通知が生じることがある。
図1は、割込みの誤通知を説明する図の一例である。時刻t1にマスターコアがスレーブコアに割込みを利用したイベントを通知し、マスターコアとスレーブコアが並行にクランク同期処理を行っている。しかし、時刻t2では、マスターコアがスレーブコアに割込みを利用してイベントを通知していないのに、スレーブコアが誤通知を受け付けている。このような誤通知は、外部からの攻撃的な手法(電気的なノイズ、割込み信号線の接触不良やショートなど)により極めて希であるが生じてしまうことがある。誤通知が生じると、スレーブコアは正しくないタイミングでクランク同期処理を行ってしまう。
However, if an interrupt request between cores is set as the processing start timing, an erroneous notification of an interrupt may occur.
FIG. 1 is an example of a diagram illustrating erroneous notification of an interrupt. At time t1, the master core notifies the slave core of an event using an interrupt, and the master core and the slave core perform crank synchronization processing in parallel. However, at time t2, although the master core does not notify the slave core of an event using an interrupt, the slave core accepts an erroneous notification. Such false notifications may occur very rarely due to an aggressive approach from the outside (such as electrical noise, interrupt signal line contact failure or short circuit). When an erroneous notification occurs, the slave core performs crank synchronization processing at an incorrect timing.
ここで、コア間でデータの送信タイミングを通知する技術が考案されている(例えば、特許文献2参照。)。特許文献2には、メインCPUはイベントデータを読み出した後、メモリに前回書き込んだ値と異なるデータを書き込み、サブCPUはメモリを常時監視して、読み出した時に値が前回読み出した値と比較して変化がある場合、メモリからデータを読み出すマルチプロセッサが開示されている。特許文献2の技術であれば、割込みの代わりにデータの監視により、処理の開始を通知することができる。 Here, a technique for notifying data transmission timing between cores has been devised (see, for example, Patent Document 2). In Patent Document 2, after reading the event data, the main CPU writes data different from the previously written value to the memory, and the sub CPU constantly monitors the memory and compares the value with the previously read value when reading. If there is a change, a multiprocessor is disclosed that reads data from memory. If it is the technique of patent document 2, the start of a process can be notified by monitoring data instead of interruption.
しかしながら、特許文献2に開示されたデータの送信タイミングの通知方法では、サブCPUが定期的にメモリにアクセスする必要があるため、サブCPUの処理負荷が大きいという問題がある。また、サブCPUが常時監視するのでなく、メインCPUがデータを書き込む定期的な周期でサブCPUがメモリを監視すれば、サブCPUの処理負荷を低減できる。しかしこの場合は、サブCPUがタイマなどの不具合によりメモリにアクセスするタイミングを逸するおそれが生じる。 However, the data transmission timing notification method disclosed in Patent Document 2 has a problem that the processing load on the sub CPU is heavy because the sub CPU needs to access the memory periodically. Further, if the sub CPU monitors the memory at a regular cycle in which data is written by the main CPU instead of being constantly monitored by the sub CPU, the processing load on the sub CPU can be reduced. However, in this case, there is a risk that the sub CPU may miss the timing of accessing the memory due to a malfunction such as a timer.
したがって、コア間の処理を同期させるには、割込みを利用しながら、処理のタイミングを正確に検出することが好ましいと考えられる。 Therefore, in order to synchronize the processing between the cores, it is preferable to accurately detect the processing timing while using the interrupt.
本発明は、上記課題に鑑み、一方のコアから他方のコアに割込みによりイベントを通知する際、イベントの誤通知を検知できるマイコンを提供することを目的とする。 In view of the above problems, an object of the present invention is to provide a microcomputer capable of detecting an erroneous notification of an event when an event is notified from one core to the other core by an interrupt.
上記課題に鑑み、本発明は、第1のコア及び第2のコアと、前記第1のコアと前記第2のコア間の通信を可能にする通信手段と、前記第1のコアと前記第2のコアが共有する共有メモリと、前記第1のコアが備える、外部信号を取得する毎に繰り返し第1の処理を実行し、前記第1の処理毎に所定情報を前記共有メモリに書き込む第1の処理手段と、前記第1の処理毎に前記通信手段を介して前記第2のコアに処理要求を出力する処理要求手段と、前記第2のコアが備える、前記処理要求をトリガーに第2の処理を実行する第2の処理手段と、を有するマイコンにおいて、前記第2のコアは、前記処理要求を受け付けた場合、前記共有メモリから最新の前記所定情報と前回の前記所定情報を読み出し、最新の前記所定情報と前回の前記所定情報に規定された関係がある場合のみ、前記第2の処理手段に前記第2の処理の実行を許可する比較手段、を有することを特徴とする。 In view of the above problems, the present invention provides a first core and a second core, communication means for enabling communication between the first core and the second core, the first core, and the first core. A shared memory shared by two cores, and a first process that is included in the first core and repeatedly executes a first process each time an external signal is acquired, and writes predetermined information to the shared memory for each first process. 1 processing means, a processing request means for outputting a processing request to the second core via the communication means for each first processing, and a processing request provided in the second core, triggered by the processing request. When the second core receives the processing request, the second core reads the latest predetermined information and the previous predetermined information from the shared memory when receiving the processing request. The latest predetermined information and the previous predetermined information Only if relationship defined in, and having a comparison means, for permitting the execution of the second process on the second processing means.
一方のコアから他方のコアに割込みによりイベントを通知する際、イベントの誤通知を検知できるマイコンを提供することができる。 When an event is notified from one core to the other core by an interrupt, a microcomputer capable of detecting an erroneous notification of the event can be provided.
以下、本発明を実施するための形態について図面を参照しながら説明する。 Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
図2は、本実施形態の電子制御装置の特徴部を模式的に説明する図の一例である。図2(a)はイベントの誤通知が生じていない場合のマスターコアとスレーブコアの処理手順を示す。
(A1)マスターコアはNEセンサからの信号入力を取得すると処理(例えば、クランクカウンタ操作処理)を行い、処理結果を共有RAMの今回値に書き込む。
(A2)マスターコアは処理が終わるとスレーブコアに割込みによるイベント通知を行う。
(A3)スレーブコアはイベント通知をトリガーに、共有RAMの前回値と今回値を比較する。今回値は、(1)のマスターコアの書き込みが正常に終了していれば、必ず前回値と異なる。
(A4)スレーブコアは今回値と前回値が異なっているはずであるという前提を利用して、今回値と前回値が異なっていれば、今回値を前回値に複写する。これにより、前回値と今回値が等しくなる(図ではどちらも30になる)。
FIG. 2 is an example of a diagram schematically illustrating the characteristic part of the electronic control device of the present embodiment. FIG. 2A shows a processing procedure of the master core and the slave core when no erroneous notification of an event has occurred.
(A1) When the master core acquires a signal input from the NE sensor, the master core performs processing (for example, crank counter operation processing) and writes the processing result in the current value of the shared RAM.
(A2) When the processing is completed, the master core notifies the slave core of an event by interruption.
(A3) The slave core compares the previous value with the current value of the shared RAM using the event notification as a trigger. The current value is always different from the previous value if the writing of the master core in (1) has been completed normally.
(A4) Using the premise that the current value and the previous value should be different, the slave core copies the current value to the previous value if the current value and the previous value are different. As a result, the previous value and the current value are equal (both are 30 in the figure).
マスターコアからスレーブコアに正常にイベント通知が出力される場合には、(A1)〜(A4)が繰り返される。スレーブコアは、今回値と前回値が異なっている場合、処理(例えば、クランク同期処理)を実行する。 When the event notification is normally output from the master core to the slave core, (A1) to (A4) are repeated. If the current value and the previous value are different, the slave core executes processing (for example, crank synchronization processing).
図2(b)はイベントの誤通知が生じた場合のマスターコアとスレーブコアの処理手順を示す。
(B1)マスターコアがイベント通知する前に、イベントの誤通知がスレーブコアに出力される。この場合、マスターコアはNEセンサからの信号入力に基づく処理も今回値の更新も行っていないので、前回値と今回値が同じ状態のままである。
(B2)スレーブコアはイベントの誤通知をトリガーに、共有RAMの前回値と今回値を比較する。
(B3)しかし、前回値と今回値が同じなので、スレーブコアはイベント通知は誤通知であったことを検出できる。イベントの誤通知を検出したスレーブコアは処理(例えば、クランク同期処理)を実行しないので、正常でないタイミングの処理を行うことを防止できる。
FIG. 2B shows a processing procedure of the master core and the slave core when an erroneous notification of an event occurs.
(B1) Before the master core notifies the event, an erroneous notification of the event is output to the slave core. In this case, since the master core does not perform processing based on signal input from the NE sensor nor update the current value, the previous value and the current value remain the same.
(B2) The slave core compares the previous value with the current value of the shared RAM, triggered by an erroneous notification of the event.
(B3) However, since the previous value and the current value are the same, the slave core can detect that the event notification is a false notification. Since the slave core that has detected the erroneous notification of the event does not execute processing (for example, crank synchronization processing), it is possible to prevent processing at an abnormal timing.
〔構成〕
図3は、電子制御装置100により制御されるエンジン200の概略構成図の一例を示す。エンジン200は、ピストン17の往復運動を回転運動に変換するレシプロエンジンである。図では気筒が1つだが通常のエンジン200は直列又はV時方向に複数の気筒を有し、各気筒のコネクティングロッド18が1つのクランクシャフト20に接続されている。
〔Constitution〕
FIG. 3 shows an example of a schematic configuration diagram of the
気筒内には、コネクティングロッド18と連結されたピストン17が収容され、気筒の内周面とピストン17によって燃焼室が形成される。燃焼室には、燃料を噴射するインジェクタ16、燃焼室で空気と燃料との混合気に点火するイグナイタ13とが設けられている。燃焼室には、吸気バルブ15で仕切られた吸入空気を供給する吸気通路14と、燃焼後の排気が排出される排気バルブ12で仕切られた排気通路11が接続されている。
A
クランクシャフト20の一端にはクランクシャフトタイミングロータ19が同軸に固定されており、クランクシャフトタイミングロータ19の外縁に対向してクランクポジションセンサ(以下、NEセンサという)21が配置されている。NEセンサ21の原理はどのようなものでもよいが、例えば、クランクシャフトタイミングロータ19の円周に等間隔に突起部を設けておき、クランクシャフト20の回転により突起部が移動することで生じる突起部とNEセンサ21のエアギャップの変化を利用する。NEセンサ21はコイルを有しておりエアギャップの変化により起電力を検出できるので、起電力の周期的な変化からクランクシャフト20の回転角を検出できる。
A
また、クランクシャフトタイミングロータ19の突起部は一箇所だけ欠けており、NEセンサ21はこれよりクランクシャフト20の基準角度(クランクシャフトが1回転したこと)を検出できるようになっている。クランクシャフトタイミングロータ19は欠損部がピストン17の上死点に一致するように取り付けられている。
Further, only one portion of the projection of the
ピストン17が下死点付近まで移動するとタイミングベルトとカムの作用で吸気バルブ15が開き、燃焼室に空気が吸気される。この時、電子制御装置(ECU)100は、クランク角に基づきピストン17の位置を検出して、インジェクタ16に燃料を噴射させる。その後、ピストン17が上死点付近まで移動すると、電子制御装置100は、クランク角に基づきピストン17の位置を検出して、イグナイタ13を通電し燃焼室の混合気に点火する。この燃焼工程によりピストン17が上死点から下死点まで移動し再度、上死点方向に移動を始めると、タイミングベルトとカムの作用で排気バルブ12が開き、燃焼室の燃焼ガスが排気される。このようなピストン17の往復運動に伴い、クランクシャフト20が回転し、車両の駆動輪に伝達される。
When the
図4は、電子制御装置100のハードウェア構成図の一例を示す。電子制御装置100はプロセッサを備えたマイコンであればよい。電子制御装置100は、マルチレイヤーバス36を介して接続されたコア(区別する場合コア1、コア2という)31、DMAC35、SDRAM37、I/Oブリッジ38及びROM39を有する。2つのコア31は、それぞれCPU32,INT33及びRAM34を有する。
FIG. 4 shows an example of a hardware configuration diagram of the
CPU32は、IFU(Instruction Fetch Unit)、DEC(DECoder)、RF(Register Fetch)、REG(REGister)、LSU(Load Store Unit)、SH(SHifter)、ALU、MUL及びFPU等の演算回路を有し、パイプライン制御により1クロックで1命令を実行する。
The
RAM1はコア1に専用のメモリ(一次キャッシュ)であり、RAM2はコア2に専用のメモリ(一次キャッシュ)である。本実施形態のコア31では、コア1がマスターコア、コア2がスレーブコアに割り当てられるが、出荷後に、コア1、2とマスターコアとスレーブコアの関係を適宜切り替え可能としてもよい。
INT1とINT2は、通信線43を介してCPU間割り込みを制御すると共に、コア1からコア2又はコア2からコア1に、パラメータ等の送受信を制御する。また、INT1,INT2は、RAM1、RAM2、又は、SDRAM37を共有の通信用メモリ(共有メモリ)にしてパラメータ等を送受信することもできる。
The
INT1 and INT2 control interrupts between CPUs via the
DMAC35は、コア1及びコア2から要求を受けてプログラム40をSDRAM37、RAM1、RAM2に読み込んだり、周辺機器からのメモリアクセス要求を調停すると共に、I/Oブリッジ38からSDRAM37へ、又は、SDRAM37からI/Oブリッジ38への、コア1、コア2を介することなくデータを転送する。SDRAM37は、コア1及びコア2にプログラム40又はデータを提供するためのメモリ(二次キャッシュ)である。SDRAM37の少なくとも一部はコア1とコア2により共有される。
The
ROM39には後述するプログラム40や、OSやデバイスドライバ(プラットフォーム)も記憶されている。
The
I/Oブリッジ38は、マルチレイヤーバス36とI/Oバス42の間で相互に周波数や電圧値などを変換する。I/Oバス42には種々のI/O41が接続されている。I/O41は電子制御装置100と外部の機器を接続するインタフェースであり、例えば、上記のNEセンサ21、CANコントローラ、各種のアクチュエータ、センサ、スイッチ等が接続される。
The I /
図5は、電子制御装置100の機能ブロック図の一例を示す。図5では説明上、重要な部品についてのみ図示した。共有RAM51はRAM1,RAM2又はSDRAM37のいずれかでよく、マスターコア52とスレーブコア53は2つのコア1、コア2のいずれかである。なお、コア1とコア2は同様のハードウェア構造としているが、マスターコア52とスレーブコア53のハードウェア構造が異なっていてもよい。
FIG. 5 shows an example of a functional block diagram of the
マスターコア52は、CPU32がプログラム40を実行して実現するクランク同期処理部54及びクランクカウンタ操作処理部55を有し、スレーブコア53はクランク同期処理部56及びクランク同期処理実行可否判定処理部57を有する。
The
まず、クランクカウンタ操作処理部55は、NEセンサ21から入力されるNEセンサ信号に基づいて、エンジン回転角をカウントしたり、エンジン回転数を算出したりする。以下、これらの処理をクランクカウンタ操作処理と称する。NEセンサ21は突起部とのエアギャップにより形成される電圧波形をパルスに整形し、パルスの立ち上がりエッジと立ち下がりエッジの各検出時点(両方を区別せずにNEセンサ信号という)を示す信号をマスターコア52に供給する。
First, the crank counter
クランクカウンタ操作処理部55は、パルスの立ち上がりエッジの検出後、立ち下がりエッジが検出されると、クランクカウンタを1つ大きくする。クランクカウンタにより、1〜36に分けられるクランクのステージと、エンジン回転角が示される。また、クランクカウンタ操作処理部55は、パルスの立ち上がりエッジから立ち下がりエッジが検出されるまでの時間を計測して記憶しておき、次に、パルスの立ち上がりエッジから立ち下がりエッジが検出されるまでの時間と比較する。2つの時間は同程度であるが、1周に1回、突起部の欠損により2つの時間の比が倍以上(又は1/2以下)程度になる。この時、クランクシャフト20が1回転したことになるので、2つの時間の比が最後に倍以上になった時から次に倍以上になるまでの時間からエンジン回転速度を求める。また、クランクカウンタ操作処理部55は、2つの時間の比が倍以上となると、クランクカウンタの値を初期化する。本実施形態ではクランクカウンタの値を今回値としてクランクカウンタ操作処理部55が共有RAM51に書き込むものとする。
The crank counter
従来からのクランク同期処理は、クランクカウンタに応じたイグナイタ13の通電タイミングの決定、イグナイタ13の点火開始タイミングの決定、及び、インジェクタ16による燃料噴射タイミングの決定、等である。また、燃料噴射タイミングの決定の前に燃料噴射量も決定される。
Conventional crank synchronization processing includes determination of energization timing of the
本実施形態のように電子制御装置100がマルチコアを有することで、クランク同期処理をマスターコア52とスレーブコア53で負荷分散することができ、より精緻なエンジン制御を可能とすることができる。例えば、従来ではクランクカウンタを24のステージに区分していた場合でも、負荷分散することでより短いステージ間隔(36ステージ)のクランク同期処理が可能になっている。
Since the
本実施形態では、マスターコア52とスレーブコア53がどのようなクランク同期処理を受け持つか設計できるが、例えば、マスターコア52のクランク同期処理部54がイグナイタ13の通電タイミングの決定とイグナイタ13の点火開始タイミングの決定を行い、スレーブコア53のクランク同期処理部56がインジェクタ16による燃料噴射量の決定と燃料噴射タイミングの決定を行うとする。
In this embodiment, it is possible to design what kind of crank synchronization processing the
クランクカウンタ操作処理部55はクランクカウンタ操作処理の後、スレーブコア53に割り込みする。スレーブコア53の割り込みハンドラはこの割り込みをトリガーにクランク同期処理実行可否判定処理部57を起動する。クランク同期処理実行可否判定処理部57について詳細は後述するが、クランク同期処理実行可否判定処理部57は、
(a)共有RAM51の今回値と前回値と比較する。
(b)今回値と前回値が同じ場合、イベントの誤通知と判定してクランク同期処理部56を呼び出さない。
(c)今回値と前回値が異なる場合、正しいイベント通知と判定して、
(c-1) 共有RAM51の今回値を前回値にコピーする。
The crank counter
(A) The current value of the shared RAM 51 is compared with the previous value.
(B) If the current value and the previous value are the same, it is determined that the event has been erroneously notified, and the crank
(C) If the current value is different from the previous value, it is determined that the event notification is correct,
(c-1) Copy the current value of the shared RAM 51 to the previous value.
(c-2) クランク同期処理部56を呼び出す(実行する)。
(c-2) Call (execute) the crank
この処理により、スレーブコア53のクランク同期処理部56は、イベントが正常に通知された場合にのみクランク同期処理を実行することができる。
With this processing, the crank
〔動作手順〕
図6は、本実施例の電子制御装置100の動作手順を示すフローチャート図の一例である。
まず、NEセンサ21がNEセンサ信号をマスターコア52に送信する(S10)。DMAC35がI/Oブリッジ38からマスターコア52のRAM1に送信するとしてもよいし、不図示のINTC(割り込みコントローラ)がNEセンサ21の割込み要求をCPUに通知することで、マスターコア52がDMAC35にRAM1にNEセンサ信号を記憶させてもよい。
[Operation procedure]
FIG. 6 is an example of a flowchart illustrating an operation procedure of the
First, the NE sensor 21 transmits an NE sensor signal to the master core 52 (S10). The
次に、マスターコア52はNEセンサ信号を受信する(S20)。NEセンサ信号を受信すると、クランクカウンタ操作処理部55がクランクカウンタ操作処理を実行する(S30)。クランクカウンタ操作処理を終えるとクランクカウンタ操作処理部55はクランクカウンタを算出するので、クランクカウンタの今回値を共有RAM51に上書きする(S40)。従来から、マスターコア52はクランクカウンタ同期処理のためクランクカウンタを算出して共有RAM51に書き込む処理を行っているので、クランクカウンタ操作処理に大きな変更はなくコスト増を抑制できる。
Next, the
なお、電子制御装置100の起動直後、クランクカウンタ操作処理部55は前回値を初期化しておく(例えば最大値(0xff)を設定)。電子制御装置100の起動直後、クランクカウンタ操作処理部55が今回値(例えばゼロ)を書き込んでも、必ず前回値と今回値を異ならせることができる。
Note that immediately after the
次に、クランクカウンタ操作処理部55はINT1と通信線43を介してスレーブコア53に割り込みする(S50)。この後、マスターコア52ではクランク同期処理部54がクランク同期処理を行う(S60)
スレーブコア53は割込みの受け付け処理を行う(S100)。割込みの受け付け処理は主にINT33が受け持つが、この処理は、例えば、実行中の処理と割込み要求の優先度の判定、割込みを受け付けると判定した場合の実行中の処理のコンテキスト(レジスタの値、演算結果、スタックポインタの値等)の記憶等である。割込みを受け付けると、スレーブコア53はクランク同期処理実行可否判定処理部57を起動させる。
Next, the crank counter
The
クランク同期処理実行可否判定処理部57は、共有RAM51の前回値と今回値を比較する(S110)。すなわち、共有RAM51の今回値と前回値が記憶されたアドレスから今回値と前回値を読み出し比較する。今回値と前回値が記憶される共有RAM51のアドレスは予め決まっている。
The crank synchronization process
今回値と前回値が一致する場合(S120のYes)、クランク同期処理実行可否判定処理部57はイベントの誤通知と判定する(S130)。この場合、スレーブコア53はクランク同期処理を実行することなく、処理を終了する。
When the current value matches the previous value (Yes in S120), the crank synchronization process execution availability
今回値と前回値が一致しない場合(S120のNo)、クランク同期処理実行可否判定処理部57は正常なイベント通知と判定する(S140)。なお、クランクカウンタは徐々に増えるのでイベント通知が正常であれば今回値と前回値は一致しないが、換言すると、今回値と前回値が一致しない情報であれば、マスターコア52のクランクカウンタ操作処理部55はどのような情報(数値、フラグ、記号、文字等)を共有メモリ51の今回値に記録してもよいことになる。クランクカウンタ以外の情報を記録する場合、クランクカウンタ操作処理部55は少なくとも連続して同じ値とならない情報を記録する。
If the current value does not match the previous value (No in S120), the crank synchronization process execution availability
次に、クランク同期処理実行可否判定処理部57は、すでに読み出している今回値を共有RAM51の前回値にコピーする(S150)。
Next, the crank synchronization process
なお、共有メモリ51に所定数(10個程度)のクランクカウンタを記憶できるリングバッファを設けることで、クランク同期処理実行可否判定処理部57が今回値を前回値にコピーすることを省略できる。この場合、クランク同期処理実行可否判定処理部57はイベント通知に連動して増えるポインタ(今回値のアドレスを示す)を備えておき、ポインタの値に応じてリングバッファの隣接した2つのクランクカウンタを読み出せばよい。
In addition, by providing a ring buffer that can store a predetermined number (about 10) of crank counters in the shared memory 51, it is possible to omit copying the current value to the previous value by the crank synchronization process
次に、クランク同期処理実行可否判定処理部57はクランク同期処理部54を呼び出すので、クランク同期処理部54はクランク同期処理を実行する(S160)。
Next, since the crank synchronization processing execution availability
以上のような処理により、スレーブコア53は、外部から生じさせられた電気的なノイズ、割込み信号線の接触不良やショートによるイベントの誤通知を正常な通知と誤判定して、クランク同期処理を実行してしまうことを防止できる。
Through the processing as described above, the
〔シーケンス〕
図7は、スレーブコア53が正常なイベント通知を取得した場合のシーケンス図の一例である。
時刻t1:マスターコア52がNEセンサ信号を受信し、クランクカウンタ操作処理を実行する。
時刻t2:マスターコア52が今回値を共有RAM51に書き込む。
時刻t3:マスターコア52がスレーブコア53にイベントを通知する。この後、マスターコア52はクランク同期処理を実行する。
時刻t4:スレーブコア53が今回値と前回値を読み出し、イベントの誤通知か否かを判定する。イベントの誤通知でない場合、スレーブコア53は今回値を前回値にコピーする。スレーブコア53はクランク同期処理を実行する。
〔sequence〕
FIG. 7 is an example of a sequence diagram when the
Time t1: The
Time t2: The
Time t3: The
Time t4: The
以降はNEセンサ21がNEセンサ信号を出力する度に、一連の処理が繰り返される。 Thereafter, each time the NE sensor 21 outputs an NE sensor signal, a series of processing is repeated.
図8は、スレーブコア53がイベントの誤通知を取得した場合のシーケンス図の一例である。時刻t1〜t4までの処理は図7と同様なので説明を省略する。
時刻t5:ノイズなどによりスレーブコア53がイベントの誤検知を取得する。スレーブコア53は今回値と前回値を読み出すが、図示するように今回値と前回値は同じままなので、イベントの誤通知と判定する。この場合、スレーブコア53は今回値を前回値にコピーせず、時刻6にてクランク同期処理を実行することもない。
FIG. 8 is an example of a sequence diagram in the case where the
Time t5: The
以上説明したように、本実施例の電子制御装置100は、一方のコアから他方のコアに割込みによりイベントを通知する際、イベントの誤通知を検知することができる。スレーブコア53の処理負荷は従来よりも若干、増大するが、共有メモリを常に監視する場合と比べれば格段に小さい処理負荷に過ぎない。
As described above, the
実施例1では2つのコアのみの存在を前提にマスターコア52とスレーブコア53の処理を説明したが、本実施例ではコアが4つある場合の、マスターコア52とスレーブコア53の処理を説明する。
In the first embodiment, the processing of the
図9は、電子制御装置100の機能ブロック図の一例を示す。図9において図5と同一部の説明は省略する。図9の電子制御装置100はマスターコア(区別するためマスターコアA、Bという)52を2つ、スレーブコア(区別するためスレーブコアA、Bという)53を2つそれぞれ有している。マスターコアAとマスターコアBは同じ機能を有し、スレーブコアAとスレーブコアBは同じ機能を有するが、エンジン200は1つなので電子制御装置100はいずれかの組の演算結果によりエンジン200を制御すればよい。例えば、IG(イグニッション)・ONの度に使用するマスターコアとスレーブコアの組を切り替えること、又は、常に2組のマスターコアとスレーブコアにより同じ演算を行い演算結果が一致する場合にエンジン制御を行うこと、などの利用態様がある。
FIG. 9 shows an example of a functional block diagram of the
本実施例のスレーブコアA、Bはクランク同期処理実行可否判定処理部57が実施例1と同様のクランク同期処理の実行可否を判定するが、さらに以下の機能を有する。
・イベントの誤検知を検知する毎に、共有RAM51の誤通知回数を1つ大きくする。
・IG・OFF時には共有RAM51の2つの誤通知回数A、Bを不揮発メモリに退避する。
In the slave cores A and B of this embodiment, the crank synchronization process execution availability
Each time an erroneous detection of an event is detected, the number of erroneous notifications in the shared RAM 51 is increased by one.
When the IG is OFF, the two erroneous notification counts A and B in the shared RAM 51 are saved in the nonvolatile memory.
スレーブコアAとスレーブコアBのクランクカウンタ操作処理部55は、誤通知を検知する度に、IG・ONなどの起動時又は定期的に、2つの誤通知回数A,Bを比較する。2つの誤通知回数A,Bの差が所定値以上になると、誤通知回数の大きい方のスレーブコア53が小さい方のスレーブコア53に対し、処理停止要求を通知する。こうすることで、イベントの誤検知が多いスレーブコア53とマスターコア52の組の演算処理を回避することができ、演算結果の信頼性を向上させることができる。
Each time the crank counter
図10は、誤通知回数に基づく演算の停止処理を説明する図の一例である。図10では、スレーブコアAがイベントの誤通知を検出した後からの処理を説明するが、スレーブコアBがイベントの誤検知を検出した場合もスレーブコアAとBの処理が逆になるだけで処理の流れは同じである。 FIG. 10 is an example of a diagram illustrating calculation stop processing based on the number of erroneous notifications. In FIG. 10, the processing after the slave core A detects an erroneous notification of the event will be described. However, when the slave core B detects an erroneous detection of the event, the processing of the slave cores A and B is only reversed. The process flow is the same.
ステップS130でイベントの誤通知を検出したスレーブコアAのクランク同期処理実行可否判定処理部57は、誤通知回数をカウントアップする(S210)。本実施例では誤通知の検出をしたタイミングで、クランク同期処理実行可否判定処理部57が2つの誤通知回数A,Bを比較する(S220)。
The crank synchronization process execution availability
クランク同期処理実行可否判定処理部57は、誤通知回数Aと誤通知回数Bの差の絶対値が閾値を超えたか否かを判定する(S230)。誤通知回数Aと誤通知回数Bは同程度になるはずなので、この閾値は有意な差として、例えば誤通知回数Aと誤通知回数Bのうち大きい方の20〜30%とする。
The crank synchronization process execution possibility
誤通知回数Aと誤通知回数Bの差の絶対値が閾値を超えていない場合(S230のNo)、クランク同期処理実行可否判定処理部57は何もせず図のフローを終了する。
When the absolute value of the difference between the erroneous notification count A and the erroneous notification count B does not exceed the threshold (No in S230), the crank synchronization process execution availability
誤通知回数Aと誤通知回数Bの差の絶対値が閾値を超えている場合(S230のYes)、誤通知回数が多い方のスレーブコア53とマスターコア52の組は信頼性が低下するおそれがあるので、クランク同期処理実行可否判定処理部57は、誤通知回数が多い方のスレーブコア53とマスターコア52の組の処理を停止させる。
・誤通知回数A−誤通知回数B>閾値
クランク同期処理実行可否判定処理部57は自身のマスターコアAとスレーブコアAの演算を停止させる。
・誤通知回数B−誤通知回数A>閾値
クランク同期処理実行可否判定処理部57は他方のマスターコアBとスレーブコアBの演算を停止させる。
If the absolute value of the difference between the number of false notifications A and the number of false notifications B exceeds the threshold (Yes in S230), the reliability of the pair of the
The number of erroneous notifications A-the number of erroneous notifications B> threshold The crank synchronization process execution availability
The number of erroneous notifications B-the number of erroneous notifications A> threshold The crank synchronization process execution availability
このため、クランク同期処理実行可否判定処理部57は、停止指示又は停止通知を他方のスレーブコアBに通知する(S240)。スレーブコアBのクランク同期処理実行可否判定処理部57は停止指示又は停止通知を受信する(S250)。
Therefore, the crank synchronization process execution availability
停止指示の場合、スレーブコアBのクランク同期処理実行可否判定処理部57はマスターコアBと通信するなどして、停止のための処理(制御中のアクチュエータなどの退避、設定の保存等)を行い、停止可能になると停止指示を受け付けたことをスレーブコアAに通知する(S260)。
In the case of a stop instruction, the slave core B crank synchronization process execution availability
スレーブコアAが停止する場合(停止通知の場合)、スレーブコアBのクランク同期処理実行可否判定処理部57は停止通知を受け付けたことをスレーブコアAに通知する(S260)。
When the slave core A stops (in the case of a stop notification), the crank synchronization process execution availability
これにより、スレーブコアAとBは停止指示又は停止に必要な処理を行う(S270、S280)。停止する側のスレーブコア53とマスターコア52は、演算を継続するスレーブコア53とマスターコア52に必要な変数などがあれば共有メモリに書き出して、電力供給をオフにする。停止しない側のスレーブコア53とマスターコア52は、演算を停止するスレーブコア53とマスターコア52から必要な変数などがあれば共有メモリから読み出して、そのまま演算を継続する。
Thereby, the slave cores A and B perform a stop instruction or a process necessary for the stop (S270, S280). The
以上説明したように、本実施例ではコアが4つあることを利用して、イベントの誤検知が多いマスターコアとスレーブコアを停止させるので、演算結果の信頼性を向上させることができる。 As described above, in the present embodiment, the master core and the slave core that are frequently erroneously detected in the event are stopped using the fact that there are four cores, so that the reliability of the calculation result can be improved.
実施例2では誤検知回数からマスターコア52とスレーブコア53の組の信頼性の低下を検出したが、本実施例では2つの演算結果が一致する場合にエンジン制御する電子制御装置100において、演算結果が一致しない場合に誤通知回数を利用してスレーブコア53の信頼性の低下を検出する電子制御装置100について説明する。
In the second embodiment, a decrease in reliability of the
すなわち、誤通知回数が多いスレーブコア53はノイズなどの影響を受けやすく正しい演算結果が得られにくいと推測して、スレーブコア53の信頼性の低下を検出することができる。
That is, it is assumed that the
図11は、電子制御装置100の機能ブロック図の一例を示す。図11において図5と同一部の説明は省略する。図11の電子制御装置100は1つのマスターコア52と、2つのスレーブコア53(スレーブコアA、B)を有している。スレーブコアAとスレーブコアBは同じ機能を有するが、本実施例ではスレーブコアBは演算結果をエンジン制御に利用することなく、共有メモリ51に書き出すものとする。そして、スレーブコアAのクランク同期処理部56は、共有メモリ51から演算結果を読み出し、自己の演算結果と比較して、略一致するかどうかによりスレーブコアAとスレーブコアBの信頼性を検証する。
FIG. 11 shows an example of a functional block diagram of the
なお、スレーブコアAが演算結果を共有メモリ51に書き出してスレーブコアBが自己の演算結果と比較してもよいし、スレーブコアAとスレーブコアBが共に演算結果を共有メモリに書き出して、不図示のスレーブコアCが演算結果を比較することもできる。 The slave core A may write the calculation result to the shared memory 51 and the slave core B may compare it with its own calculation result. Both the slave core A and the slave core B write the calculation result to the shared memory and The illustrated slave core C can also compare the calculation results.
スレーブコアAは、演算結果が例えば所定回数以上異なった場合、誤通知回数Aと誤通知回数Bの大きい方のスレーブコア53に異常があると推定し、その後の演算を中止させる。こうすることで、誤通知回数の大小だけでなく、演算結果を利用して、異常が生じている可能性の高いスレーブコア53や通信線ン43の断線やショートを特定することができる。また、実施例2では誤通知回数A、Bの差の絶対値が閾値を超える必要があったが、本実施例では誤通知回数A、Bの差の絶対値が閾値を超えなくても異常のある可能性の高いスレーブコア53を特定できる。
For example, when the calculation results differ by a predetermined number of times or more, the slave core A estimates that there is an abnormality in the
図12は、演算結果と誤通知回数に基づく演算処理の停止処理を説明する図の一例である。図12では、スレーブコアA、Bがクランク同期処理を開始する時以降の手順を説明する。 FIG. 12 is an example of a diagram illustrating a calculation process stop process based on the calculation result and the number of erroneous notifications. FIG. 12 illustrates a procedure after the slave cores A and B start crank synchronization processing.
まず、スレーブBのクランク同期処理部56がクランク同期処理の演算結果を共有メモリに書き込む(S310)。書き込んだ場合、クランク同期処理部56はスレーブコアAに割込みやコア間通信により通知することが好ましい。
First, the crank
スレーブコアAのクランク同期処理部56もほぼ同時期にクランク同期処理を終了させる(S320)。クランク同期処理部56は共有メモリ51の演算結果を読み出して、自身の演算結果と一致するか否かを判定する(S330)。なお、演算結果の有効桁数や丸め方にもよるが、どちらのスレーブコアA,Bも正常だが演算結果が完全には一致しないことがあるので、一致したと見なせる範囲(例えば、数%〜10%程度の違い)を設けて、一致判定する。
The crank
2つの演算結果が一致した場合(S330のYes)、スレーブコアAのクランク同期処理部56は自己の演算結果を用いてエンジン200を制御する(S340)。
When the two calculation results match (Yes in S330), the crank
2つの演算結果が一致しない場合(S330のNo)、スレーブコアAのクランク同期処理部56は、誤通知回数Aと誤通知回数Bを共有メモリ51から読み出し、比較する(S350)。そして、クランク同期処理部56は誤通知回数の大小に応じて停止指示又は停止の処理を実行する(S360)。
When the two calculation results do not match (No in S330), the crank
・誤通知回数A>誤通知回数Bの場合
スレーブコアAのクランク同期処理部56は、スレーブコアBにクランク同期処理を依頼する。これにより、以降は、スレーブコアBのクランク同期処理部56がクランク同期処理の演算結果を用いてエンジン200を制御することができる。なお、以降は、スレーブコアBのクランク同期処理部56は共有メモリ51に演算結果を書き出さなくてよい。
When the erroneous notification count A> the erroneous notification count B, the crank
・誤通知回数A<誤通知回数Bの場合、
スレーブコアAのクランク同期処理部56は、スレーブコアBにクランク同期処理の停止を依頼する。これにより、以降は、スレーブコアBのクランク同期処理部56はクランク同期処理を行わず、共有メモリ51に演算結果を書き出すこともしない。また、スレーブコアAのクランク同期処理部56は、自己のクランク同期処理の演算結果によりエンジン200を制御する。
・ If false notification count A <false notification count B,
The crank
・誤通知回数A=誤通知回数Bの場合、
この場合、演算結果が一致しないことがイベントの誤検知とは異なる原因の可能性もあるので、例えば、マスターコア52にスレーブコア53のクランク同期処理を依頼し、スレーブコアAとスレーブコアBの演算結果のどちらが正しいかを検証する、又は、第4のコアにスレーブコア53のクランク同期処理を依頼し、スレーブコアAとスレーブコアBの演算結果のどちらが正しいかを検証する、ことができる。スレーブコアAとスレーブコアBの演算結果のどちらが正しいかが分かれば、正しくない方のスレーブコア53にクランク同期処理の停止を依頼する。
・ In case of false notification count A = false notification count B,
In this case, the fact that the calculation results do not match may be different from the erroneous detection of the event. For example, the
以上説明したように、本実施例の電子制御装置100は、誤通知回数が多いスレーブコア53はノイズなどの影響を受けやすく正しい演算結果が得られにくいと推定して、スレーブコア53の信頼性の低下を検出することができる。
As described above, the
本実施例ではハイブリッド車両に電子制御装置100が搭載された場合に、イベントの誤通数を検出することを停止する電子制御装置100について説明する。
In this embodiment, an
図13は、ハイブリッドECU101と車載LANを介して接続された電子制御装置(エンジンECU)100を示す図の一例である。ハイブリッドECU101は、バッテリ残量、アクセルペダルの踏み込み量、車速等に基づき、パワーモード、エコモード、又は、EVモードの3つのモードに切り替えることができる。このうちEVモードは電気モータだけで走行するモードでエンジン200は強制的に停止される。
FIG. 13 is an example of a diagram showing an electronic control unit (engine ECU) 100 connected to the
EVモードにおいても電子制御装置100には電力が供給され、NEセンサ21がNEセンサ信号を出力すれば、クランクカウンタ操作処理やクランク同期処理が実行され得る状態にある。しかし、EVモードでは、エンジン200が停止しているためNEセンサ信号が出力されるはずがなく、マスターコア52からスレーブコア53にイベント通知が出力されるはずがない。
Even in the EV mode, if electric power is supplied to the
したがって、本実施例のようにハイブリッド車に搭載された電子制御装置100は、EVモードであることを検出すると、クランク同期処理実行可否判定処理部57が、イベントの通知を受け付けただけでそれが誤通知であることを検出できる。したがって、今回値と前回値の比較をしてイベントの誤通知を検出する必要がない。
Therefore, when the
また、誤通知回数の差に基づき停止するマスターコア52とスレーブコア53を決定する場合、及び、複数のスレーブコア53がクランク同期処理を実行して演算結果が一致した場合にエンジン制御する場合、EVモードにおける誤通知回数をカウントしておけば、信頼性の高いスレーブコア53を特定しやすくなる。
Further, when determining the
本実施例の電子制御装置100は、ハイブリッド車に搭載された場合、EVモードを利用してイベントの誤検知を容易に検出することができる。
When the
21 NEセンサ
51 共有メモリ
52 マスターコア
53 スレーブコア
54、56 クランク同期処理部
55 クランクカウンタ操作処理部
57 クランク同期実行可否判定処理部
100 電子制御装置
200 エンジン
21 NE sensor 51
Claims (9)
前記第1のコアと前記第2のコア間の通信を可能にする通信手段と、
前記第1のコアと前記第2のコアが共有する共有メモリと、
前記第1のコアが備える、外部信号を取得する毎に繰り返し第1の処理を実行し、前記第1の処理毎に所定情報を前記共有メモリに書き込む第1の処理手段と、
前記第1の処理毎に前記通信手段を介して前記第2のコアに処理要求を出力する処理要求手段と、
前記第2のコアが備える、前記処理要求をトリガーに第2の処理を実行する第2の処理手段と、を有するマイコンであって、
前記第2のコアは、前記処理要求を受け付けた場合、前記共有メモリから最新の前記所定情報と前回の前記所定情報を読み出し、最新の前記所定情報と前回の前記所定情報に規定された関係がある場合のみ、前記第2の処理手段に前記第2の処理の実行を許可する比較手段、を有することを特徴とするマイコン。 A first core and a second core;
Communication means for enabling communication between the first core and the second core;
A shared memory shared by the first core and the second core;
A first processing unit included in the first core that repeatedly executes a first process every time an external signal is acquired, and writes predetermined information to the shared memory for each first process;
Processing request means for outputting a processing request to the second core via the communication means for each first processing;
A second processing unit that executes a second process triggered by the processing request provided in the second core;
When the second core receives the processing request, the second core reads the latest predetermined information and the previous predetermined information from the shared memory, and the relationship defined by the latest predetermined information and the previous predetermined information is determined. A microcomputer comprising: a comparison unit that permits the second processing unit to execute the second process only in some cases.
ことを特徴とする請求項1記載のマイコン。 The comparison unit determines that the processing request is an erroneous notification when there is no relationship defined in the latest predetermined information and the previous predetermined information.
The microcomputer according to claim 1.
ことを特徴とする請求項1又は2記載のマイコン。 The comparison means, when there is a relationship defined in the latest predetermined information and the previous predetermined information, the latest predetermined information of the shared memory is copied to the previous predetermined information;
The microcomputer according to claim 1 or 2.
前記規定された関係は、最新の前記所定情報が前回の前記所定情報よりも大きいことである、ことを特徴とする請求項4記載のマイコン。 The first processing means stores, in the shared memory, the processing result of the first processing whose numerical value increases for each of the first processing as the predetermined information,
5. The microcomputer according to claim 4, wherein the specified relationship is that the latest predetermined information is larger than the previous predetermined information.
前記第2の処理手段及び前記比較手段を備えた第4のコアと、を有し、
前記第2のコアと前記第4のコアの前記比較手段は、最新の前記所定情報と前回の前記所定情報に規定された関係がなかった回数をそれぞれカウントして、
2つの前記回数の違いが閾値を超えた場合、前記回数が多い方の前記第1のコアと前記第2のコア又は前記第3のコアと前記第4のコアが有する、前記第1の処理手段、前記第2の処理手段及び前記比較手段を停止する、
ことを特徴とする請求項1〜5いずれか1項記載のマイコン。 A third core comprising the first processing means;
A fourth core provided with the second processing means and the comparison means,
The comparing means of the second core and the fourth core respectively count the number of times the relationship between the latest predetermined information and the previous predetermined information is not defined,
When the difference between the two times exceeds a threshold, the first processing of the first core and the second core or the third core and the fourth core having the larger number of times Stopping the means, the second processing means and the comparison means;
The microcomputer according to any one of claims 1 to 5.
前記第2のコアと前記第3のコアの前記比較手段は、最新の前記所定情報と前回の前記所定情報に規定された関係がなかった回数をそれぞれカウントし、
前記第2のコアの前記第2の処理手段は、前記第3のコアの前記第2の処理手段の処理結果が自己の前記第2の処理手段の処理結果と略一致する場合に処理結果を制御に用い、
前記第3のコアの前記第2の処理手段の処理結果が自己の前記第2の処理手段の処理結果と略一致しない場合、
前記第2のコアの前記第2の処理手段は、自己の前記回数が前記第3のコアの前記回数よりも少ない場合に前記第3のコアの前記第2の処理手段及び前記比較手段を停止し、
自己の前記回数が前記第3のコアの前記回数よりも多い場合に自己の前記第2の処理手段及び前記比較手段を停止する、
ことを特徴とする請求項1〜5いずれか1項記載のマイコン。 A third core comprising the second processing means and the comparison means;
The comparing means of the second core and the third core respectively count the number of times that there was no relationship defined in the latest predetermined information and the previous predetermined information,
The second processing unit of the second core outputs a processing result when the processing result of the second processing unit of the third core substantially matches the processing result of the second processing unit of its own. Used for control,
When the processing result of the second processing means of the third core does not substantially match the processing result of the second processing means of its own,
The second processing unit of the second core stops the second processing unit and the comparison unit of the third core when the number of times of the second core is smaller than the number of times of the third core. And
Stopping the second processing means and the comparing means of itself when the number of times of the self is greater than the number of times of the third core;
The microcomputer according to any one of claims 1 to 5.
ことを特徴とする請求項1〜7いずれか1項記載のマイコン。 The first process is a process of counting the crank angle, and the second process is a determination of the energization timing of the igniter and a determination of the ignition start timing of the igniter, or the determination of the fuel injection amount by the injector and the fuel injection timing Is a decision,
The microcomputer according to any one of claims 1 to 7, characterized in that:
第1のコアの第1の処理手段が、外部信号を取得する毎に繰り返し第1の処理を実行し、前記第1の処理毎に所定情報を前記第1のコアと第2のコアが共有する前記共有メモリに書き込むステップと、
前記第1のコアの処理要求手段が、前記第1のコアと前記第2のコア間の通信を可能にする通信手段を介して前記第1の処理毎に前記第2のコアに処理要求を出力するステップと、
前記第2のコアの比較手段が、前記処理要求を受け付けた場合、前記共有メモリから最新の前記所定情報と前回の前記所定情報を読み出し、最新の前記所定情報と前回の前記所定情報に規定された関係がある場合のみ、第2の処理手段に第2の処理の実行を許可するステップと、
前記第2のコアの前記第2の処理手段が前記処理要求をトリガーに前記第2の処理を実行するステップと、
を有する処理同期方法。
A process synchronization method for a microcomputer having a plurality of cores,
The first processing unit of the first core repeatedly executes the first process every time an external signal is acquired, and the first core and the second core share predetermined information for each first process. Writing to the shared memory;
The processing request means of the first core sends a processing request to the second core for each of the first processes via a communication means that enables communication between the first core and the second core. Output step;
When the second core comparison unit accepts the processing request, it reads the latest predetermined information and the previous predetermined information from the shared memory, and is defined in the latest predetermined information and the previous predetermined information. A step of permitting the second processing means to execute the second process only when there is a relationship,
The second processing means of the second core executing the second processing triggered by the processing request;
A process synchronization method comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010258047A JP2012108786A (en) | 2010-11-18 | 2010-11-18 | Microcomputer and processing synchronization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010258047A JP2012108786A (en) | 2010-11-18 | 2010-11-18 | Microcomputer and processing synchronization method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012108786A true JP2012108786A (en) | 2012-06-07 |
Family
ID=46494330
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010258047A Pending JP2012108786A (en) | 2010-11-18 | 2010-11-18 | Microcomputer and processing synchronization method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012108786A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016165912A (en) * | 2015-03-09 | 2016-09-15 | 株式会社デンソー | Electronic control unit |
JP2017068802A (en) * | 2015-10-02 | 2017-04-06 | 株式会社デンソー | Electronic control unit |
WO2018003560A1 (en) | 2016-06-30 | 2018-01-04 | 日立オートモティブシステムズ株式会社 | Electronic control device |
-
2010
- 2010-11-18 JP JP2010258047A patent/JP2012108786A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016165912A (en) * | 2015-03-09 | 2016-09-15 | 株式会社デンソー | Electronic control unit |
JP2017068802A (en) * | 2015-10-02 | 2017-04-06 | 株式会社デンソー | Electronic control unit |
WO2018003560A1 (en) | 2016-06-30 | 2018-01-04 | 日立オートモティブシステムズ株式会社 | Electronic control device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5816572B2 (en) | Vehicle control device | |
JP2010126012A (en) | Vehicle control multi-core system or internal-combustion engine control device | |
JP2011133337A (en) | Abnormality determination device for rotation sensor | |
JP2012108786A (en) | Microcomputer and processing synchronization method | |
JP2011002993A (en) | Watchdog timer monitoring device, and watchdog timer monitoring method | |
JP4310744B2 (en) | Engine control device | |
JP6729407B2 (en) | Microcomputer | |
US20070109308A1 (en) | Inter-cpu data transfer device | |
US9335749B2 (en) | Semiconductor data processing apparatus and engine control apparatus | |
JP5246154B2 (en) | Control device for internal combustion engine | |
JP5556760B2 (en) | Engine control device | |
JP5659995B2 (en) | Electronic control unit | |
JP2013061783A (en) | Multi-core processor | |
JP2021163425A (en) | Electronic control device | |
JP6466269B2 (en) | Electronic control device and stack area usage monitoring method | |
JP7314838B2 (en) | electronic controller | |
CN109844288B (en) | Method for processing engine position data by multi-core computer | |
JP6771272B2 (en) | In-vehicle electronic control device and stack usage | |
JP2013160133A (en) | Electronic control device and control method | |
US6904543B2 (en) | Electronic control having floating-point data check function | |
JP2681771B2 (en) | Electronic ignition timing control method for internal combustion engine | |
JP6877475B2 (en) | Electronic control device and stack usage | |
JP6071697B2 (en) | Internal combustion engine control device, internal combustion engine control method, and program | |
JP2021152338A (en) | Controller | |
JP2020112104A (en) | Internal combustion engine control device |