JP2020126477A - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP2020126477A
JP2020126477A JP2019018880A JP2019018880A JP2020126477A JP 2020126477 A JP2020126477 A JP 2020126477A JP 2019018880 A JP2019018880 A JP 2019018880A JP 2019018880 A JP2019018880 A JP 2019018880A JP 2020126477 A JP2020126477 A JP 2020126477A
Authority
JP
Japan
Prior art keywords
core
shared resource
operation clock
monitoring
cores
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2019018880A
Other languages
Japanese (ja)
Inventor
健弘 久間
Takehiro Kuma
健弘 久間
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 JP2019018880A priority Critical patent/JP2020126477A/en
Publication of JP2020126477A publication Critical patent/JP2020126477A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Multi Processors (AREA)
  • Microcomputers (AREA)

Abstract

To provide an electronic control device capable of suppressing deterioration of real-time property.SOLUTION: A microcomputer includes a plurality of cores, a shared resource that can be used by the plurality of cores, a plurality of multipliers that set the operating clock of each core, and a monitoring core that sets the values of the multipliers. When each core acquires a right to use the shared resource, the core occupies the shared resource so that other cores cannot use the shared resource until the usage right is released. The monitoring core detects an occupying core that occupies the shared resource among the multiple cores, and sets values of the multipliers in order to make the operating clock of the occupying core faster than the one set when the occupying core does not occupy the shared resource (S10 to S16).SELECTED DRAWING: Figure 3

Description

本開示は、電子制御装置に関する。 The present disclosure relates to electronic control devices.

従来、特許文献1に開示された、複数のコアを備えた電子制御装置がある。電子制御装置は、複数の異なる周波数を生成可能な周波数生成回路と、複数のコアのそれぞれに対し、周波数生成回路によって生成された複数の異なる周波数のうちのいずれか一の周波数を切り替えて接続可能な切替装置とを備えている。 Conventionally, there is an electronic control device including a plurality of cores disclosed in Patent Document 1. The electronic control unit can connect to each of the frequency generation circuit capable of generating a plurality of different frequencies and the plurality of cores by switching any one of the plurality of different frequencies generated by the frequency generation circuit. And a switching device.

特開2017−199221号公報JP, 2017-199221, A

ところで、複数のコアを備えた電子制御装置では、複数のコアがリソースを共有することがある。この場合、電子制御装置は、複数のコアにおける一つのコアが共有リソースを占有することができる。そして、他のコアは、共有リソースを占有しようとした場合、共有リソースを占有しているコアが、共有リソースを解放するのを待たなければならない。 By the way, in an electronic control device having a plurality of cores, the plurality of cores may share resources. In this case, in the electronic control device, one core among the plurality of cores can occupy the shared resource. Then, when another core tries to occupy the shared resource, it has to wait for the core occupying the shared resource to release the shared resource.

よって、特許文献1の電子制御装置は、周波数を遅く設定したコアが共有リソースを占有してしまった場合、共有リソースの解放が遅くなる。つまり、電子制御装置は、共有リソースを占有しようとしているコアが、共有リソースが解放されるのを待つ時間が長くなる。このため、電子制御装置は、リアルタイム性が損なわれる問題がある。 Therefore, in the electronic control device of Patent Document 1, release of the shared resource is delayed when the core whose frequency is set slow occupies the shared resource. That is, the electronic control device takes a long time to wait for the core, which is trying to occupy the shared resource, to release the shared resource. Therefore, the electronic control device has a problem that the real-time property is impaired.

本開示は、上記問題点に鑑みなされたものであり、リアルタイム性が損なわれることを抑制できる電子制御装置を提供することを目的とする。 The present disclosure has been made in view of the above problems, and an object of the present disclosure is to provide an electronic control device that can suppress deterioration of real-time property.

上記目的を達成するために本開示は、
複数の処理部(11、12、13、14)と、
複数の処理部が使用可能な少なくとも一つの共有リソース(40、41、42)と、
各処理部の動作クロックを管理する動作クロック管理部(10、31、32、33、34)と、を備え、
各処理部は、共有リソースの使用権を獲得すると、使用権を解放するまでの間、他の処理部が共有リソースを使用できないように共有リソースを占有し、
動作クロック管理部は、複数の処理部のうち共有リソースを占有している占有処理部を検出するとともに、占有処理部の動作クロックを、共有リソースを占有していない場合よりも高速化することを特徴とする。
In order to achieve the above object, the present disclosure provides
A plurality of processing units (11, 12, 13, 14),
At least one shared resource (40, 41, 42) usable by a plurality of processing units,
An operation clock management unit (10, 31, 32, 33, 34) that manages the operation clock of each processing unit,
When each processing unit acquires the usage right of the shared resource, it occupies the shared resource so that other processing units cannot use the shared resource until the usage right is released.
The operation clock management unit detects an occupancy processing unit that occupies the shared resource among the plurality of processing units, and speeds up the operation clock of the occupancy processing unit as compared with the case where the shared resource is not occupied. Characterize.

このように、本開示は、占有処理部の動作クロックを、共有リソースを占有していない場合よりも高速化するため、占有処理部の動作クロックを高速化しない場合よりも、共有リソースを占有している時間を短くすることができる。よって、本開示は、リアルタイム性が損なわれることを抑制できる。 As described above, according to the present disclosure, the operation clock of the occupancy processing unit is made faster than that in the case where the shared resource is not occupied. The time spent can be shortened. Therefore, the present disclosure can suppress the loss of real-time property.

なお、特許請求の範囲、及びこの項に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本開示の技術的範囲を限定するものではない。 It should be noted that the claims and the reference numerals in parentheses described in this section indicate the corresponding relationship with the specific means described in the embodiments described below as one aspect, and the technical scope of the present disclosure. Is not limited.

第1実施形態におけるマイコンを含むディスプレイシステムの概略構成を示すブロック図である。It is a block diagram showing a schematic structure of a display system including a microcomputer in a 1st embodiment. 第1実施形態におけるマイコンの状態遷移を示すステートマシン図である。FIG. 3 is a state machine diagram showing state transitions of a microcomputer in the first embodiment. 第1実施形態における監視コアの処理動作を示すフローチャートである。6 is a flowchart showing the processing operation of the monitoring core in the first embodiment. 第1実施形態における監視コアの高速化コア決定処理を示すフローチャートである。It is a flow chart which shows speed-up core decision processing of a surveillance core in a 1st embodiment. 第1実施形態におけるマイコンの処理動作を示すタイムチャートである。6 is a time chart showing the processing operation of the microcomputer in the first embodiment. 第2実施形態におけるマイコンの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the microcomputer in 2nd Embodiment. 第2実施形態における監視コアの高速化コア決定処理を示すフローチャートである。It is a flowchart which shows the speed-up core determination process of the monitoring core in 2nd Embodiment. 第2実施形態におけるマイコンの処理動作を示すタイムチャートである。9 is a time chart showing the processing operation of the microcomputer in the second embodiment. 変形例における監視コアの高速化コア決定処理を示すフローチャートである。It is a flowchart which shows the speed-up core determination process of the monitoring core in a modification.

以下において、図面を参照しながら、本開示を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。 Hereinafter, a plurality of modes for carrying out the present disclosure will be described with reference to the drawings. In each form, parts corresponding to the matters described in the preceding form may be assigned the same reference numerals and overlapping description may be omitted. In each mode, when only a part of the configuration is described, the other modes described earlier can be applied to other parts of the configuration.

図1〜図5を用いて、本実施形態の電子制御装置に関して説明する。本実施形態では、一例として、ディスプレイシステムにおけるマイコン100を含む電子制御装置に適用した例を採用する。また、ディスプレイシステムは、例えば、車両に搭載されたものを採用できる。しかしながら、本開示は、これに限定されず、表示装置400とは異なる制御対象を制御するシステムに適用することもできる。 The electronic control unit of the present embodiment will be described with reference to FIGS. In this embodiment, as an example, an example applied to an electronic control device including the microcomputer 100 in the display system is adopted. Further, as the display system, for example, one installed in a vehicle can be adopted. However, the present disclosure is not limited to this, and can be applied to a system that controls a control target different from the display device 400.

図1に示すように、ディスプレイシステムは、マイコン100、発振器200、第1映像演算装置310、第2映像演算装置320、表示装置400などを含んでいる。ディスプレイシステムは、表示装置400における表示制御を行うシステムである。表示装置400は、例えば、液晶ディスプレイや有機ELディスプレイなどを採用できる。 As shown in FIG. 1, the display system includes a microcomputer 100, an oscillator 200, a first video processing device 310, a second video processing device 320, a display device 400, and the like. The display system is a system that controls display in the display device 400. The display device 400 can employ, for example, a liquid crystal display or an organic EL display.

第1映像演算装置310は、第2マイコン311などを備えている。第2映像演算装置320は、第3マイコン321などを備えている。各映像演算装置310、320は、マイコン100からの制御信号に基づいて、各マイコン311、321が演算処理を行う。各マイコン311、321は、演算処理の処理結果に基づいて、表示装置400に描画するための表示制御を行う。 The first video calculation device 310 includes a second microcomputer 311 and the like. The second video calculation device 320 includes a third microcomputer 321 and the like. In each of the video calculation devices 310 and 320, each of the microcomputers 311 and 321 performs a calculation process based on a control signal from the microcomputer 100. Each of the microcomputers 311 and 321 performs display control for drawing on the display device 400 based on the processing result of the arithmetic processing.

ディスプレイシステムは、表示装置400への描画のリアルタイム性が求められる。つまり、電子制御装置は、表示装置400への描画の指示が発生してから、短時間で、実際に表示装置400に描画することが求められる。また、電子制御装置は、表示装置400とは異なる制御対象を制御する場合、制御対象への制御指示のリアルタイム制が求められる。 The display system is required to have real-time drawing on the display device 400. That is, the electronic control device is required to actually draw on the display device 400 in a short time after the drawing instruction to the display device 400 is issued. Further, when the electronic control device controls a control target different from the display device 400, real-time control of a control instruction to the control target is required.

さらに、電子制御装置では、マイコン100の消費電力を抑える必要がある。言い換えると、電子制御装置では、マイコン100が電力を消費することによる発熱を抑える必要がある。 Further, in the electronic control device, it is necessary to reduce the power consumption of the microcomputer 100. In other words, in the electronic control device, it is necessary to suppress heat generation due to the microcomputer 100 consuming electric power.

マイコン100は、監視コア10、第1コア11、第2コア12、第3コア13、第1ROM21、第2ROM22、第3ROM23、第1逓倍器31、第2逓倍器32、第3逓倍器33、共有リソース40、スピンロック部50などを備えている。このように、マイコン100は、複数のコア10〜13を備えているため、マルチコアマイコンと言える。また、マイコン100は、各コア10〜13の動作クロックを生成する発振器200が接続されている。 The microcomputer 100 includes a monitoring core 10, a first core 11, a second core 12, a third core 13, a first ROM 21, a second ROM 22, a third ROM 23, a first multiplier 31, a second multiplier 32, a third multiplier 33, The shared resource 40 and the spin lock unit 50 are provided. As described above, since the microcomputer 100 includes the plurality of cores 10 to 13, it can be said that it is a multi-core microcomputer. Further, the microcomputer 100 is connected to an oscillator 200 that generates an operation clock for each of the cores 10 to 13.

共有リソース40は、複数のコア11〜13が使用可能なリソースである。共有リソース40は、複数のコア11〜13が使用可能であるが、同時に複数のコア11〜13が使用しないように排他処理がなされる。この排他処理に関しては、後程説明する。共有リソース40は、例えばメモリや入出力装置(I/O)などを採用することができる。また、共有リソース40としてのメモリは、メモリ装置の一部の領域であってもよい。なお、本実施形態では、一つの共有リソース40を備えたマイコン100を採用している。しかしながら、マイコン100は、複数の共有リソースを備えていてもよい。 The shared resource 40 is a resource that can be used by the plurality of cores 11 to 13. The shared resource 40 can be used by the plurality of cores 11 to 13, but exclusive processing is performed so that the plurality of cores 11 to 13 are not used at the same time. This exclusive processing will be described later. As the shared resource 40, for example, a memory or an input/output device (I/O) can be adopted. The memory as the shared resource 40 may be a partial area of the memory device. In this embodiment, the microcomputer 100 having one shared resource 40 is adopted. However, the microcomputer 100 may include a plurality of shared resources.

スピンロック部50は、各コア11〜13が共有リソース40を占有して、排他するための部位である。スピンロック部50は、共有リソース40が占有状態であることを示す態様と、解放状態であることを示す態様とに遷移可能に構成されている。例えば、スピンロック部50は、各コア11〜13によって、スピンロック占有情報として占有状態であることを示す情報と、解放状態であることを示す情報とが格納可能に構成されている。 The spin lock unit 50 is a unit for the cores 11 to 13 to occupy and exclude the shared resource 40. The spin lock unit 50 is configured to be capable of transitioning between a mode indicating that the shared resource 40 is in the occupied state and a mode indicating that it is in the released state. For example, the spin lock unit 50 is configured such that the cores 11 to 13 can store, as the spin lock occupancy information, information indicating an occupied state and information indicating a released state.

なお、スピンロック部50は、占有状態であることを示す情報と、解放状態であることを示す情報とが同時に格納されることはない。スピンロック部50は、常に、占有状態であることを示す情報と、解放状態であることを示す情報のいずれか一方のみが格納されている。 The spin lock unit 50 does not store the information indicating the occupied state and the information indicating the released state at the same time. The spin lock unit 50 always stores only one of the information indicating the occupied state and the information indicating the released state.

つまり、スピンロック部50は、複数のコア11〜13のうち、共有リソース40の使用権を獲得したコア(以下占有コア)によって、占有状態であることを示す情報が、占有コアと関連付けられて格納される。また、スピンロック部50は、占有コアが共有リソース40を解放した場合に、占有コアによって、解放状態であることを示す情報が格納される。このように、占有状態とは、複数のコア11〜13のいずれかが共有リソース40の使用権を獲得している状態である。一方、解放状態は、占有コアが共有リソース40の使用権を解放した状態である。 That is, the spinlock unit 50 associates the information indicating the occupied state with the dedicated core by the core (hereinafter, the dedicated core) that has acquired the right to use the shared resource 40 among the plurality of cores 11 to 13. Is stored. In the spin lock unit 50, when the dedicated core releases the shared resource 40, the dedicated core stores information indicating that the shared resource 40 is in the released state. As described above, the occupied state is a state in which any of the plurality of cores 11 to 13 has acquired the right to use the shared resource 40. On the other hand, the released state is a state in which the dedicated core releases the right to use the shared resource 40.

なお、例えば、スピンロック部50は、占有状態であることを示す情報として1が占有コアに関連付けられて格納されるとともに、解放状態であることを示す情報として0が格納される。よって、スピンロック部50は、例えばレジスタなどを採用できる。スピンロック占有情報は、排他情報とも言える。占有コアは、占有処理部に相当する。 Note that, for example, the spin lock unit 50 stores 1 as the information indicating the occupied state in association with the occupied core and 0 as the information indicating the released state. Therefore, the spin lock unit 50 can employ, for example, a register. The spinlock occupation information can be said to be exclusive information. The dedicated core corresponds to the dedicated processing unit.

マイコン100は、複数のコア10〜13として、表示装置400の表示制御に関する処理を行なう第1コア11〜第3コア13と、各逓倍器31〜33を用いて各コア11〜13の動作クロックを設定する監視コア10を備えている。 The microcomputer 100 uses, as the plurality of cores 10 to 13, a first core 11 to a third core 13 that performs processing relating to display control of the display device 400, and operating clocks of the cores 11 to 13 using the multipliers 31 to 33. The monitoring core 10 for setting

第1コア11は、第1コア11用の記憶部として第1ROM21が接続され、且つ、第1コア11用の動作クロックを設定するための部位として第1逓倍器31が接続されている。また、第1コア11は、共有リソース40及びスピンロック部50が接続されている。 The first core 11 is connected to the first ROM 21 as a storage unit for the first core 11, and is also connected to the first multiplier 31 as a portion for setting an operation clock for the first core 11. The shared resource 40 and the spin lock unit 50 are connected to the first core 11.

第1コア11は、第1逓倍器31から動作クロックが供給されて動作する。第1逓倍器31は、第1コア11の動作クロックを独立に変更可能とする部位である。第1逓倍器31は、発振器200から供給された基準クロックの周波数を逓倍するための装置である。第1逓倍器31は、監視コア10によって設定された設定値に応じた周波数の動作クロックを第1コア11に供給する。 The first core 11 operates by being supplied with an operation clock from the first multiplier 31. The first multiplier 31 is a part that can independently change the operation clock of the first core 11. The first multiplier 31 is a device for multiplying the frequency of the reference clock supplied from the oscillator 200. The first multiplier 31 supplies an operation clock having a frequency according to the set value set by the monitoring core 10 to the first core 11.

第1逓倍器31は、例えば、設定値として、高速モード時の設定値と低速モード時の設定値の二つの値が設定可能に構成されている。高速モードと低速モードは、各コア11〜13の動作モードである。高速モードと低速モードは、相対的な動作クロックの違いを示している。よって、高速モードは、低速モードよりも動作クロックが上げられた動作モードを示している。第1コア11は、第1逓倍器31に高速モード時の設定値が設定されていると高速モードで動作し、第1逓倍器31に低速モード時の設定値が設定されていると低速モードで動作する。 The first multiplier 31 is configured such that, for example, two values, a set value in the high speed mode and a set value in the low speed mode, can be set as the set values. The high speed mode and the low speed mode are operation modes of the cores 11 to 13. The high speed mode and the low speed mode show a relative difference in operating clock. Therefore, the high speed mode indicates an operation mode in which the operation clock is raised as compared with the low speed mode. The first core 11 operates in the high speed mode when the set value in the high speed mode is set in the first multiplier 31, and operates in the low speed mode when the set value in the low speed mode is set in the first multiplier 31. Works with.

なお、第1コア11は、第1コア11が共有リソース40の使用権を獲得した場合に、動作モードが高速モードとされ、第1コア11が共有リソース40の使用権を獲得していない場合に、動作モードが低速モードとされる。つまり、第1コア11は、第1コア11が共有リソース40の使用権を獲得していない通常の場合に、動作モードが低速モードとされる。このため、低速モードは、通常モードと言い換えることもできる。 The operation mode of the first core 11 is set to the high speed mode when the first core 11 acquires the right to use the shared resource 40, and the first core 11 does not acquire the right to use the shared resource 40. In addition, the operation mode is set to the low speed mode. That is, the operation mode of the first core 11 is set to the low speed mode in the normal case where the first core 11 has not acquired the right to use the shared resource 40. Therefore, the low speed mode can be restated as the normal mode.

第1コア11は、例えば第1ROM21に記憶されたプログラムを実行することで、第1ROM21や共有リソース40に記憶されたデータなどを用いつつ演算処理を実行する。 The first core 11 executes, for example, a program stored in the first ROM 21 to execute arithmetic processing while using the data stored in the first ROM 21 and the shared resource 40.

第1コア11は、共有リソース40が解放状態の場合に限って、共有リソース40を使用することができる。第1コア11は、共有リソース40の使用権を獲得できた場合、スピンロック部50に、占有状態であることを示す情報を第1コア11に関連付けて格納する。第1コア11は、共有リソース40の使用権を獲得すると、使用権を解放するまでの間、他のコア12、13が共有リソース40を使用できないように共有リソース40を占有することができる。そして、第1コア11は、共有リソース40を解放する場合、スピンロック部50に解放状態であることを示す情報を格納する。このようにして、第1コア11は、排他処理を行う。なお、排他処理に関しては、上記に限定されず、ミューテックスなどであっても採用できる。 The first core 11 can use the shared resource 40 only when the shared resource 40 is in the released state. When the first core 11 can acquire the right to use the shared resource 40, the first core 11 stores the information indicating the occupied state in the spin lock unit 50 in association with the first core 11. When the first core 11 acquires the usage right of the shared resource 40, the first core 11 can occupy the shared resource 40 so that the other cores 12 and 13 cannot use the shared resource 40 until the usage right is released. Then, when releasing the shared resource 40, the first core 11 stores information indicating that it is in the released state in the spin lock unit 50. In this way, the first core 11 performs exclusive processing. Note that the exclusive processing is not limited to the above, and even a mutex or the like can be adopted.

第2コア12は、第2コア12用の記憶部として第2ROM22が接続され、且つ、第2コア12用の動作クロックを設定するための部位として第2逓倍器32が接続されている。また、第2コア12は、共有リソース40及びスピンロック部50が接続されている。第3コア13は、第3コア13用の記憶部として第3ROM23が接続され、且つ、第3コア13用の動作クロックを設定するための部位として第3逓倍器33が接続されている。また、第3コア13は、共有リソース40及びスピンロック部50が接続されている。 The second core 12 is connected to the second ROM 22 as a storage unit for the second core 12, and is also connected to the second multiplier 32 as a portion for setting an operation clock for the second core 12. The shared resource 40 and the spin lock unit 50 are connected to the second core 12. The third core 13 is connected to the third ROM 23 as a storage unit for the third core 13, and is also connected to the third multiplier 33 as a portion for setting an operation clock for the third core 13. The shared resource 40 and the spin lock unit 50 are connected to the third core 13.

第2コア12と第3コア13は、第1コア11と同様に構成されている。また、第2ROM22と第3ROM23は、第1ROM21と同様に構成されている。さらに、第2逓倍器32と第3逓倍器33は、第1逓倍器31と同様に構成されている。よって、各コアは、共有リソース40の使用権を獲得すると、使用権を解放するまでの間、他のコアが共有リソース40を使用できないように共有リソース40を占有することができる。 The second core 12 and the third core 13 are configured similarly to the first core 11. Further, the second ROM 22 and the third ROM 23 are configured similarly to the first ROM 21. Further, the second multiplier 32 and the third multiplier 33 are configured similarly to the first multiplier 31. Therefore, when each core acquires the usage right of the shared resource 40, it can occupy the shared resource 40 so that other cores cannot use the shared resource 40 until the usage right is released.

このように、マイコン100は、ディスプレイシステムの性能上、複数のコア11〜13を備えたマルチコアマイコンとして構成されている。しかしながら、マイコン100は、常時、複数のコア11〜13を高速モードで動作させることは発熱の面から避けることが望ましい。 As described above, the microcomputer 100 is configured as a multi-core microcomputer including the plurality of cores 11 to 13 in view of the performance of the display system. However, it is desirable for the microcomputer 100 to avoid operating the plurality of cores 11 to 13 in the high speed mode all the time from the viewpoint of heat generation.

監視コア10は、共有リソース40の占有状態を検出する機能と、各逓倍器31〜33の設定変更を行う機能を有している。図2には、監視コア10が制御する各コア11〜13の各逓倍器31〜33のステートマシンを図示している。 The monitoring core 10 has a function of detecting the occupied state of the shared resource 40 and a function of changing the settings of the multipliers 31 to 33. FIG. 2 shows a state machine of the multipliers 31 to 33 of the cores 11 to 13 controlled by the monitoring core 10.

監視コア10は、スピンロック部50に格納されている、共有リソース40の2つの状態(スピンロック状態)を示すスピンロック占有情報を取得する。そして、監視コア10は、そのスピンロック占有情報から、複数のコア11〜13のいずれかが共有リソース40を占有しているか否かを検出する。共有リソース40における1つの状態は、複数のコア11〜13のいずれかが共有リソース40を占有している占有状態である。もう1つの状態は、複数のコア11〜13のいずれも共有リソース40を占有していない状態、すなわち、共有リソース40が解放されている解放状態である。 The monitoring core 10 acquires spin lock occupation information stored in the spin lock unit 50, which indicates two states (spin lock states) of the shared resource 40. Then, the monitoring core 10 detects whether any of the plurality of cores 11 to 13 occupies the shared resource 40 from the spin lock occupancy information. One state in the shared resource 40 is an occupied state in which one of the cores 11 to 13 occupies the shared resource 40. The other state is a state in which none of the plurality of cores 11 to 13 occupies the shared resource 40, that is, a released state in which the shared resource 40 is released.

なお、複数のコア11〜13のいずれかが共有リソース40を占有することを、共有リソース40のスピンロック占有とも称する。一方、占有コアが共有リソースを解放することを、共有リソース40のスピンロック解放とも称する。 Note that occupying the shared resource 40 by any of the plurality of cores 11 to 13 is also referred to as spin lock occupancy of the shared resource 40. On the other hand, releasing the shared resource by the dedicated core is also referred to as releasing the spinlock of the shared resource 40.

また、図2に示すように、監視コア10は、各逓倍器31〜33の設定値を変更することで、各コア11〜13の動作モードを高速モードまたは低速モードに変更する。監視コア10は、共有リソース40を占有している占有コアに対応する逓倍器を高速モードにする。また、監視コア10は、共有リソース40を占有している占有コアが使用権を解放すると、占有コアに対応する逓倍器を低速モードにする。 Further, as shown in FIG. 2, the monitoring core 10 changes the operation mode of each of the cores 11 to 13 to the high speed mode or the low speed mode by changing the set value of each of the multipliers 31 to 33. The monitoring core 10 puts the multiplier corresponding to the dedicated core occupying the shared resource 40 into the high speed mode. Further, when the dedicated core occupying the shared resource 40 releases the usage right, the monitoring core 10 puts the multiplier corresponding to the dedicated core into the low speed mode.

なお、第1コア11、第2コア12、第3コア13のそれぞれは、処理部に相当する。監視コア10、第1逓倍器31、第2逓倍器32、第3逓倍器33は、動作クロック管理部に相当する。 Each of the first core 11, the second core 12, and the third core 13 corresponds to a processing unit. The monitoring core 10, the first multiplier 31, the second multiplier 32, and the third multiplier 33 correspond to an operation clock management unit.

ここで、図3、図4、図5に基づいて、マイコン100と監視コア10の処理動作に関して説明する。監視コア10は、所定時間毎に、図3のフローチャートに示す処理を実行する。 Here, the processing operation of the microcomputer 100 and the monitoring core 10 will be described with reference to FIGS. 3, 4, and 5. The monitoring core 10 executes the processing shown in the flowchart of FIG. 3 every predetermined time.

ステップS10では、スピンロック状態を検出する(動作クロック管理部)。監視コア10は、スピンロック部50に格納されているスピンロック占有情報を取得して、取得したスピンロック占有情報に基づいてスピンロック状態を検出する。つまり、監視コア10は、複数のコア11〜13のいずれかが共有リソース40を占有している占有状態であるか、複数のコア11〜13のいずれも共有リソース40を占有していない解放状態であるかを検出する。 In step S10, the spin lock state is detected (operation clock management unit). The monitoring core 10 acquires the spin lock occupancy information stored in the spin lock unit 50, and detects the spin lock state based on the acquired spin lock occupancy information. That is, the monitoring core 10 is in an occupied state in which one of the plurality of cores 11 to 13 occupies the shared resource 40, or a released state in which none of the plurality of cores 11 to 13 occupies the shared resource 40. Is detected.

ステップS11では、共有リソースを占有しているコアがあるか否かを判定する(動作クロック管理部)。監視コア10は、ステップS10での検出結果に基づいて、共有リソース40を占有しているコアがあるか否かを判定する。そして、監視コア10は、共有リソース40を占有しているコアが有ると判定した場合はステップS12へ進み、共有リソース40を占有しているコアが有ると判定しなかった場合はステップS17へ進む。 In step S11, it is determined whether or not there is a core occupying the shared resource (operation clock management unit). The monitoring core 10 determines whether or not there is a core occupying the shared resource 40 based on the detection result in step S10. Then, if the monitoring core 10 determines that there is a core that occupies the shared resource 40, the process proceeds to step S12, and if it does not determine that there is a core that occupies the shared resource 40, the process proceeds to step S17. ..

ステップS12では、共有リソースを占有しているコアを特定する(動作クロック管理部)。監視コア10は、ステップS10での検出結果に基づいて、共有リソース40を占有しているコアを特定する。つまり、監視コア10は、スピンロック占有情報に基づいて、複数のコア11〜13のうち、共有リソース40を占有している占有コアを特定する。 In step S12, the core occupying the shared resource is specified (operation clock management unit). The monitoring core 10 identifies the core occupying the shared resource 40 based on the detection result in step S10. That is, the monitoring core 10 identifies the dedicated core that occupies the shared resource 40 among the plurality of cores 11 to 13 based on the spinlock occupation information.

なお、監視コア10は、今回の占有コアと、前回の占有コアが同一であるか否かを判定するために、特定した占有コアをメモリなどに記憶してもよい。 The monitoring core 10 may store the specified dedicated core in a memory or the like in order to determine whether the current dedicated core and the previous dedicated core are the same.

ステップS13では、前回の占有しているコアと同一であるか否かを判定する。監視コア10は、今回の占有コアと前回の占有コアとが同一であると判定しなかった場合はステップS14に進み、今回の占有コアと前回の占有コアとが同一であると判定した場合は図3の処理を終了する。 In step S13, it is determined whether it is the same as the previously occupied core. If the monitoring core 10 does not determine that the current dedicated core and the previous dedicated core are the same, the monitoring core 10 proceeds to step S14, and if it determines that the current dedicated core and the previous dedicated core are the same. The process of FIG. 3 is terminated.

後程説明するが、監視コア10は、占有コアの動作モードを高速モードに設定する。ただし、監視コア10は、今回の占有コアが前回の占有コアと同一の場合、今回の占有コアの動作モードを高速モードに設定することなく、現在の動作モードを維持する。なお、本開示は、ステップS13を実行しない監視コア10であっても採用できる。また、占有コアが前回と同じ場合には、占有コアの動作モードは、既に高速モードに設定されており、動作モードを変更する必要がない。これによって、本開示は、監視コア10の動作モード変更による処理負荷を削減するために、現在の動作モードを維持する(動作モードの設定を変更しない)。 As will be described later, the monitoring core 10 sets the operation mode of the dedicated core to the high speed mode. However, when the occupied core of this time is the same as the occupied core of the previous time, the monitoring core 10 maintains the current operation mode without setting the operation mode of the occupied core of this time to the high speed mode. Note that the present disclosure can be adopted even in the monitoring core 10 that does not execute step S13. Further, when the occupied core is the same as the previous one, the operation mode of the occupied core is already set to the high speed mode, and it is not necessary to change the operation mode. Accordingly, the present disclosure maintains the current operation mode (does not change the operation mode setting) in order to reduce the processing load due to the operation mode change of the monitoring core 10.

ステップS14では、高速化するコアを決定する(動作クロック管理部)。ここで、図4を用いて、高速化コア決定処理に関して説明する。監視コア10は、ステップS14で高速化するコアを決定する場合、図4のフローチャートで示す処理を実行する。 In step S14, the core to be accelerated is determined (operation clock management unit). Here, the accelerated core determination process will be described with reference to FIG. When determining the core to be accelerated in step S14, the monitoring core 10 executes the process shown in the flowchart of FIG.

ステップS20では、共有リソースを占有しているコアを確認する。監視コア10は、スピンロック部50に格納されているスピンロック占有情報に基づいて、共有リソース40を占有しているコアを確認する。そして、監視コア10は、占有コアが第1コア11の場合はステップS21へ進み、占有コアが第2コア12の場合はステップS22へ進み、占有コアが第1コア11の場合はステップS23へ進む。 In step S20, the core occupying the shared resource is confirmed. The monitoring core 10 confirms the core occupying the shared resource 40 based on the spinlock occupancy information stored in the spinlock unit 50. Then, the monitoring core 10 proceeds to step S21 when the occupied core is the first core 11, proceeds to step S22 when the occupied core is the second core 12, and proceeds to step S23 when the occupied core is the first core 11. move on.

ステップS21では、第1コアを高速化する対象とする。ステップS22では、第2コアを高速化する対象とする。ステップS23では、第3コアを高速化する対象とする。このように、監視コア10は、複数のコア11〜13のうち共有リソース40を占有している占有コアを検出する。なお、監視コア10は、ステップS13を実行しない場合、ステップS12で特定した占有コアを高速化するコアに決定する。 In step S21, the first core is targeted for speed-up. In step S22, the second core is targeted for speed-up. In step S23, the third core is targeted for speeding up. In this way, the monitoring core 10 detects the occupied core that occupies the shared resource 40 among the plurality of cores 11 to 13. In addition, when not performing step S13, the monitoring core 10 determines the dedicated core identified in step S12 as a core to be accelerated.

ここで、図3のフローチャートの説明に戻る。監視コア10は、高速化するコアを決定すると、ステップS15へ進む。 Here, the description returns to the flowchart of FIG. When the monitoring core 10 determines the core to be accelerated, the monitoring core 10 proceeds to step S15.

ステップS15では、すべてのコアを低速モードに設定する(動作クロック管理部)。監視コア10は、一旦、すべてのコア11〜13を低速モードに設定する。監視コア10は、各逓倍器31〜33に対して、低速モード時の設定値を設定することで、すべてのコア11〜13を低速モードにする。 In step S15, all the cores are set to the low speed mode (operation clock management unit). The monitoring core 10 once sets all the cores 11 to 13 in the low speed mode. The monitoring core 10 sets all the cores 11 to 13 in the low speed mode by setting the setting values in the low speed mode for the respective multipliers 31 to 33.

後程説明するが、監視コア10は、占有コアを高速モードに設定する。そこで、監視コア10は、占有コアを検出した場合、すべてのコア11〜13の動作クロックを低速化した後に、占有コアの動作クロックのみを高速化する。これによって、電子制御装置は、占有コアのみを高速化することができるので、確実にマイコン100での消費電力を抑制できる。なお、本開示は、ステップS15を実行しない監視コア10であっても採用できる。 As will be described later, the monitoring core 10 sets the dedicated core in the high speed mode. Therefore, when detecting the occupied core, the monitoring core 10 reduces the operation clocks of all the cores 11 to 13 and then increases the operation clock of only the occupied core. As a result, the electronic control device can speed up only the occupied core, so that the power consumption of the microcomputer 100 can be reliably suppressed. Note that the present disclosure can be adopted even in the monitoring core 10 that does not execute step S15.

ステップS16では、決定したコアを高速モードに設定する(動作クロック管理部)。監視コア10は、占有コアに対応する逓倍器に対して、高速モード時の設定値を設定することで、占有コアを高速モードに設定する。つまり、監視コア10は、占有コアの動作クロックを、共有リソース40を占有していない場合よりも高速化する。このため、占有コアは、高速モードの状態で、共有リソース40を使用する。 In step S16, the determined core is set to the high speed mode (operation clock management unit). The monitoring core 10 sets the dedicated core in the high speed mode by setting the set value in the high speed mode for the multiplier corresponding to the occupied core. That is, the monitoring core 10 speeds up the operation clock of the occupied core as compared with the case where the shared resource 40 is not occupied. Therefore, the dedicated core uses the shared resource 40 in the high speed mode.

このように、マイコン100は、占有コアの動作クロックを、共有リソース40を占有していない場合よりも高速化するため、占有コアの動作クロックを高速化しない場合よりも、共有リソース40を占有している時間を短くすることができる。よって、電子制御装置は、リアルタイム性が損なわれることを抑制できる。また、これによって、電子制御装置は、表示装置400に対する描写のリアルタイム性を確保することができる。 In this way, the microcomputer 100 speeds up the operating clock of the dedicated core more than when it does not occupy the shared resource 40. Therefore, the microcomputer 100 occupies the shared resource 40 more than when it does not speed up the operating clock of the dedicated core. The time spent can be shortened. Therefore, the electronic control device can suppress the deterioration of the real-time property. Further, by this, the electronic control device can ensure real-time rendering of the display device 400.

つまり、監視コア10は、例えば、スピンロック部50を確認して、占有コアが第1コア11であることを検出した場合、第1逓倍器31を高速モード時の設定値に設定する。これにより、第1コア11は、低速モード時よりも早く動作し、低速モードで動作している場合よりも、共有リソース40を占有する時間を短縮できる。よって、マイコン100は、ディスプレイシステムのリアルタイム性を保つことができる。 That is, for example, when the monitoring core 10 checks the spin lock unit 50 and detects that the occupied core is the first core 11, the monitoring core 10 sets the first multiplier 31 to the set value in the high speed mode. As a result, the first core 11 operates faster than in the low speed mode and can occupy the shared resource 40 for a shorter time than in the case of operating in the low speed mode. Therefore, the microcomputer 100 can maintain the real-time property of the display system.

次に、ステップS11でNO判定した場合に関して説明する。ステップS17では、復帰条件を満たすか否かを判定する(動作クロック管理部)。監視コア10は、予め決められた復帰条件を満たすか否かを判定し、復帰条件を満たすと判定した場合はステップS18へ進み、復帰条件を満たさないと判定した場合は図3の処理を終了する。復帰条件は、高速モードに設定した占有コアの動作モードを低速モードへ復帰させてもいいか否かを判断するための条件である。復帰条件は、低速化条件に相当する。 Next, the case where NO is determined in step S11 will be described. In step S17, it is determined whether or not the return condition is satisfied (operation clock management unit). The monitoring core 10 determines whether or not a predetermined return condition is satisfied. If it is determined that the return condition is satisfied, the process proceeds to step S18, and if it is determined that the return condition is not satisfied, the process of FIG. 3 ends. To do. The return condition is a condition for determining whether or not the operation mode of the dedicated core set to the high speed mode can be returned to the low speed mode. The return condition corresponds to the speed reduction condition.

復帰条件としては、例えば、占有コアが共有リソース40の使用権を解放したことを採用できる。この場合、監視コア10は、スピンロック部50のスピンロック占有情報を確認して、解放状態であることを示す情報が格納されている場合、すなわち、占有コアが共有リソース40の使用権を解放していた場合、低速化条件を満たしたと判定する。つまり、監視コア10は、ステップS11でNO判定したことで、復帰条件を満たしているとみなすことになる。これによって、マイコン100は、占有コアの動作クロックを即座に低速化できるので、消費電力を抑制できる。 As the return condition, for example, the exclusive core releasing the right to use the shared resource 40 can be adopted. In this case, the monitoring core 10 confirms the spin lock occupation information of the spin lock unit 50, and when the information indicating the released state is stored, that is, the dedicated core releases the right to use the shared resource 40. If so, it is determined that the speed reduction condition is satisfied. That is, the monitoring core 10 determines that the return condition is satisfied by making the NO determination in step S11. As a result, the microcomputer 100 can immediately reduce the operating clock of the dedicated core, and thus can suppress power consumption.

また、復帰条件としては、例えば、複数のコア11〜13が共有リソース40を占有していない状況が所定時間継続したことを採用できる。言い換えると、復帰条件は、占有コアが共有リソース40を解放して所定時間が経過したことを採用できる。 Further, as the return condition, for example, it is possible to adopt that a situation in which the plurality of cores 11 to 13 do not occupy the shared resource 40 continues for a predetermined time. In other words, the return condition can be that the predetermined time has elapsed since the dedicated core released the shared resource 40.

この場合、監視コア10は、スピンロック部50のスピンロック占有情報を確認して、解放状態であることを示す情報が格納されているとタイマーなどを用いて計時を開始する。監視コア10は、計時を開始してから所定時間が経過する前に、占有状態であることを示す情報が格納されると計時した時間をクリアする。そして、監視コア10は、解放状態であることを示す情報が格納されている状況が所定時間継続した場合、復帰条件を満たしたと判定する。これによって、マイコン100は、動作クロックの変化が連続して生じることを抑制できる。なお、本開示は、ステップS17を実行しない監視コア10であっても採用できる。 In this case, the monitoring core 10 confirms the spin lock occupation information of the spin lock unit 50, and if the information indicating the released state is stored, starts the time measurement using a timer or the like. The monitoring core 10 clears the counted time when the information indicating the occupied state is stored before a predetermined time has elapsed from the start of the counting. Then, the monitoring core 10 determines that the return condition is satisfied when the situation in which the information indicating the released state is stored continues for a predetermined time. As a result, the microcomputer 100 can suppress continuous changes in the operation clock. Note that the present disclosure can be adopted even in the monitoring core 10 that does not execute step S17.

ステップS18では、すべてのコアを低速モードに設定する(動作クロック管理部)。監視コア10は、占有コアに対応する逓倍器に対して、低速モード時の設定値を設定することで、占有コアを低速モードに設定する。つまり、監視コア10は、占有コアの動作クロックを、共有リソース40を占有している場合よりも低速化する。このため、共有リソース40を解放したコアは、低速モードの状態で処理を行う。これにより、マイコン100は、共有リソース40を解放したコアが高速モード時よりも遅く動作するため消費電力を抑えることができる。 In step S18, all the cores are set to the low speed mode (operation clock management unit). The monitoring core 10 sets the dedicated core in the low speed mode by setting the setting value in the low speed mode for the multiplier corresponding to the occupied core. In other words, the monitoring core 10 makes the operating clock of the dedicated core slower than when it occupies the shared resource 40. Therefore, the core that has released the shared resource 40 performs processing in the low speed mode. As a result, the microcomputer 100 can suppress power consumption because the core that has released the shared resource 40 operates slower than in the high speed mode.

また、占有コアに高速モードが設定されている場合、その他のコアは、低速モードに設定されている。このため、監視コア10は、占有コアに対応する逓倍器に対して、低速モード時の設定値を設定することで、すべてのコア11〜13を低速モードに設定することになる。 When the high speed mode is set for the occupied core, the other cores are set for the low speed mode. Therefore, the monitoring core 10 sets all the cores 11 to 13 in the low speed mode by setting the setting value in the low speed mode for the multiplier corresponding to the occupied core.

ここで、図5を用いて、動作クロックを高速化しない比較例のマイコン(以下比較例)と対比しつつ、本実施形態のマイコン100の効果を説明する。図5は、(a)が比較例の処理動作を示すタイムチャートであり、(b)がマイコン100の処理動作を示すタイムチャートである。なお、以下においては、比較例のマイコン、第1コア〜第3コア、共有リソースに対して、符号を付与せず記載する。 Here, the effect of the microcomputer 100 of the present embodiment will be described with reference to FIG. 5 in comparison with a microcomputer of a comparative example (hereinafter, comparative example) in which the operation clock is not speeded up. FIG. 5A is a time chart showing the processing operation of the comparative example, and FIG. 5B is a time chart showing the processing operation of the microcomputer 100. In the following, reference numerals are not given to the microcomputer, the first core to the third core, and the shared resource of the comparative example.

第1コア〜第3コアのそれぞれは、第1コア11〜第3コア13のそれぞれと同じ処理を行なうものとする。しかしながら、第1コア〜第3コアのそれぞれは、第1コア11〜第3コア13のそれぞれと異なり、高速モードで動作することなく、常時、低速モードで動作するものである。 Each of the first core to the third core performs the same processing as that of each of the first core 11 to the third core 13. However, unlike the first core 11 to the third core 13, the first core to the third core do not operate in the high speed mode but always operate in the low speed mode.

図5では、各コアが処理中の期間を白抜き四角、占有コアが共有リソースに対する処理中の期間をハッチング付きの四角で示している。また、図5では、コア処理開始を白抜き矢印、コアと共有リソース間処理を破線矢印で示している。さらに、図5では、共有リソースの占有を丸印、共有リソースの占有失敗をバツ(×)印で示している。 In FIG. 5, the period during which each core is processing is indicated by a white square, and the period during which the dedicated core is processing the shared resource is indicated by a hatched square. Further, in FIG. 5, the core processing start is indicated by a white arrow, and the processing between the core and the shared resource is indicated by a broken arrow. Further, in FIG. 5, the occupation of the shared resource is indicated by a circle, and the failure of occupation of the shared resource is indicated by a cross (x).

例えば、図5(b)の第2コア12は、タイミングt14からタイミングt21の期間で処理を行なっている。図5(b)の第1コア11は、タイミングt12で共有リソース40を占有して、タイミングt16までの期間で共有リソース40に対する処理を行ない、タイミングt16で共有リソース40を解放している。図5(b)の第2コア12は、タイミング15で共有リソース40を占有しようとするが、既に、第1コア11によって共有リソース40が占有されているため、占有失敗となっている。 For example, the second core 12 in FIG. 5B is performing the process during the period from timing t14 to timing t21. The first core 11 in FIG. 5B occupies the shared resource 40 at the timing t12, performs the processing on the shared resource 40 until the timing t16, and releases the shared resource 40 at the timing t16. The second core 12 in FIG. 5B attempts to occupy the shared resource 40 at the timing 15, but the shared resource 40 has already been occupied by the first core 11, and therefore the occupancy has failed.

なお、タイミングt1は、タイミングt11に対応している。つまり、図5は、第1コア〜第3コアを備えた比較例のマイコンと、第1コア11〜第3コア13を備えたマイコン100の処理時間を比較した図面と言える。また、図5(b)のタイミングt8は、図5(a)のタイミングt8を示している。 The timing t1 corresponds to the timing t11. That is, FIG. 5 can be said to be a drawing comparing the processing times of the microcomputer of the comparative example including the first to third cores and the microcomputer 100 including the first to third cores 11 to 13. Further, the timing t8 in FIG. 5(b) indicates the timing t8 in FIG. 5(a).

図5(a)に示すように、第1コアは、タイミングt1で処理を開始する。そして、第1コアは、タイミングt2からタイミングt5の期間で共有リソースを占有して、タイミングt5で共有リソースを解放する。第1コアは、動作クロックを高速化しないため、タイミングt1〜t2の間だけでなく、タイミング2〜t5の間も低速モードで動作することになる。 As shown in FIG. 5A, the first core starts processing at timing t1. Then, the first core occupies the shared resource during the period from the timing t2 to the timing t5 and releases the shared resource at the timing t5. Since the first core does not speed up the operation clock, it operates in the low speed mode not only between timings t1 and t2 but also between timings 2 and t5.

一方、図5(b)に示すように、第1コア11は、タイミングt11で処理を開始する。そして、第1コア11は、タイミングt12からタイミングt16の期間で共有リソース40を占有して、タイミングt16で共有リソース40を解放する。 On the other hand, as shown in FIG. 5B, the first core 11 starts processing at timing t11. Then, the first core 11 occupies the shared resource 40 during the period from the timing t12 to the timing t16, and releases the shared resource 40 at the timing t16.

このとき、監視コア10は、第1コア11が共有リソース40を占有しているタイミングt13で、第1逓倍器31を高速モード時の設定値に設定する。よって、第1コア11は、動作クロックが高速化された高速モードの状態で、共有リソース40を使用する。 At this time, the monitoring core 10 sets the first multiplier 31 to the set value in the high speed mode at the timing t13 when the first core 11 occupies the shared resource 40. Therefore, the first core 11 uses the shared resource 40 in the high speed mode in which the operation clock is speeded up.

このため、第1コア11は、第1コアと同じ処理を実行するにもかかわらず、第1コアよりも共有リソース40の占有時間が短い。よって、第1コア11が共有リソース40を占有している時間(t12〜t16)は、第1コアが共有リソースを占有している時間(t2〜t5)よりも短い。 Therefore, the first core 11 performs the same processing as the first core, but the occupied time of the shared resource 40 is shorter than that of the first core. Therefore, the time during which the first core 11 occupies the shared resource 40 (t12 to t16) is shorter than the time during which the first core 11 occupies the shared resource (t2 to t5).

なお、本実施形態では、複数のコア11〜13が共有リソース40を占有していない状況が所定時間継続した場合に、占有コアを低速モードに遷移させる例を採用している。このため、占有コアである第1コア11は、タイミングt17、t20で低速モードが設定される。これにより、マイコン100は、共有リソース40を解放したコアが高速モード時よりも遅く動作するため消費電力を抑えることができる。 It should be noted that the present embodiment adopts an example in which the occupied cores are transited to the low speed mode when a plurality of cores 11 to 13 do not occupy the shared resource 40 for a predetermined time. Therefore, the low speed mode is set for the first core 11, which is the occupied core, at the timings t17 and t20. As a result, the microcomputer 100 can suppress power consumption because the core that has released the shared resource 40 operates slower than in the high speed mode.

上記のように、第1コア11と第1コアは、同じ処理を実行するものであり、且つ、共有リソース40を占有していない場合、低速モードで動作する。このため、タイミングt12は、タイミングt2に対応する。つまり、タイミングt1からタイミングt2までの経過時間は、タイミングt11からタイミングt12までの経過時間と同様である。 As described above, the first core 11 and the first core execute the same processing, and when they do not occupy the shared resource 40, they operate in the low speed mode. Therefore, the timing t12 corresponds to the timing t2. That is, the elapsed time from the timing t1 to the timing t2 is the same as the elapsed time from the timing t11 to the timing t12.

また、図5(a)に示すように、第2コアは、タイミングt3で処理を開始して、タイミングt4で共有リソースを占有しようとする。しかしながら、共有リソースは、既に第1コアによって占有されている。このため、第2コアは、占有に失敗し、共有リソースが解放されるまで待機する。 Further, as shown in FIG. 5A, the second core starts processing at timing t3 and tries to occupy the shared resource at timing t4. However, the shared resource is already occupied by the first core. Therefore, the second core fails to occupy and waits until the shared resource is released.

そして、第2コアは、第1コアがタイミングt5で共有リソースを解放した後、タイミングt6で共有リソースを占有する。その後、第2コアは、タイミングt7までの間で共有リソースを占有し、タイミングt7で共有リソースを解放してタイミングt8まで処理を行う。第2コアは、第1コアと同様、動作クロックを高速化しないため、タイミングt3〜t8の全期間において低速モードで動作することになる。 Then, the second core occupies the shared resource at timing t6 after the first core releases the shared resource at timing t5. After that, the second core occupies the shared resource until the timing t7, releases the shared resource at the timing t7, and performs the process until the timing t8. Like the first core, the second core does not speed up the operation clock, and therefore operates in the low speed mode during the entire period from timing t3 to timing t8.

一方、図5(b)に示すように、第2コア12は、タイミングt14で処理を開始して、タイミングt15で共有リソース40を占有しようとする。しかしながら、比較例と同様に、共有リソース40は、既に第1コア11によって占有されている。このため、第2コア12は、占有に失敗し、共有リソース40が解放されるまで待機する。そして、第2コア12は、共有リソースが解放されるまで待機して、タイミングt17で共有リソースを占有する。 On the other hand, as shown in FIG. 5B, the second core 12 starts processing at timing t14 and tries to occupy the shared resource 40 at timing t15. However, as in the comparative example, the shared resource 40 is already occupied by the first core 11. Therefore, the second core 12 fails to occupy and waits until the shared resource 40 is released. Then, the second core 12 waits until the shared resource is released, and occupies the shared resource at timing t17.

しかしながら、第1コア11は、上記のように、第1コアよりも、共有リソース40の占有時間が短い。このため、第2コア12は、第2コアよりも、共有リソース40が解放されるまでの待機時間が短い。よって、第2コア12は、第2コアよりも早く共有リソース40を占有することができる。 However, as described above, the first core 11 occupies the shared resource 40 for a shorter time than the first core. Therefore, the second core 12 has a shorter waiting time than the second core until the shared resource 40 is released. Therefore, the second core 12 can occupy the shared resource 40 earlier than the second core.

また、監視コア10は、第2コア12が共有リソース40を占有しているタイミングt18で、第2逓倍器32を高速モード時の設定値に設定する。よって、第2コア12は、動作クロックが高速化された高速モードの状態で、共有リソース40を使用する。このため、第2コア12は、第1コア11と同様、第2コアよりも共有リソース40の占有時間を短縮させることができる。よって、第2コア12が共有リソース40を占有している時間(t17〜t19)は、第2コアが共有リソースを占有している時間(t6〜t7)よりも短い。 Further, the monitoring core 10 sets the second multiplier 32 to the set value in the high speed mode at the timing t18 when the second core 12 occupies the shared resource 40. Therefore, the second core 12 uses the shared resource 40 in the high speed mode in which the operation clock is speeded up. Therefore, like the first core 11, the second core 12 can shorten the occupied time of the shared resource 40 more than the second core. Therefore, the time during which the second core 12 occupies the shared resource 40 (t17 to t19) is shorter than the time during which the second core 12 occupies the shared resource (t6 to t7).

なお、各コア11〜13と比較例の各コアは、同じ処理を実行するものである。このため、第2コア12が処理を開始するタイミングt14は、第2コアが処理を開始するタイミングt3に対応する。つまり、タイミングt1からタイミングt3までの経過時間は、タイミングt11からタイミングt14までの経過時間と同様である。 The cores 11 to 13 and the cores of the comparative example execute the same processing. Therefore, the timing t14 when the second core 12 starts the processing corresponds to the timing t3 when the second core starts the processing. That is, the elapsed time from the timing t1 to the timing t3 is the same as the elapsed time from the timing t11 to the timing t14.

また、第2コア12と第2コアは、同じ処理を実行するものであり、且つ、共有リソース40を占有していない場合、低速モードで動作する。このため、タイミングt7からタイミングt8までの経過時間は、タイミングt19からタイミングt21までの経過時間と同様である。 Further, the second core 12 and the second core perform the same processing, and when they do not occupy the shared resource 40, they operate in the low speed mode. Therefore, the elapsed time from timing t7 to timing t8 is the same as the elapsed time from timing t19 to timing t21.

このように、各コア11〜13は、各コアよりも、共有リソース40の占有時間が短くなるだけでなく、共有リソース40が解放されることを待つ待機時間が短くなる。このため、本実施形態の例では、マイコンがタイミングt8で第2コアの処理が完了するのに対して、マイコン100は、タイミングt8よりも早く、タイミングt21で第2コア12の処理が完了する。よって、マイコン100は、リアルタイム性が損なわれることを抑制できる。 In this way, each core 11 to 13 not only has a shorter occupied time of the shared resource 40 than each core, but also has a shorter waiting time to wait for the shared resource 40 to be released. Therefore, in the example of the present embodiment, the microcomputer completes the processing of the second core at the timing t8, whereas the microcomputer 100 completes the processing of the second core 12 at the timing t21 earlier than the timing t8. .. Therefore, the microcomputer 100 can suppress the loss of real-time property.

以上、本開示の好ましい実施形態について説明した。しかしながら、本開示は、上記実施形態に何ら制限されることはなく、本開示の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本開示のその他の形態として、第2、第3実施形態に関して説明する。上記実施形態及び第2、第3実施形態は、それぞれ単独で実施することも可能であるが、適宜組み合わせて実施することも可能である。本開示は、実施形態において示された組み合わせに限定されることなく、種々の組み合わせによって実施可能である。 The preferred embodiments of the present disclosure have been described above. However, the present disclosure is not limited to the above embodiment, and various modifications can be made without departing from the spirit of the present disclosure. The second and third embodiments will be described below as other embodiments of the present disclosure. The above-described embodiments and the second and third embodiments can be carried out independently, but can also be carried out in an appropriate combination. The present disclosure is not limited to the combinations shown in the embodiments and can be implemented by various combinations.

(第2実施形態)
図6〜図8を用いて、第2実施形態の電子制御装置に関して説明する。本実施形態の電子制御装置は、マイコン110を備えている点が上記実施形態と異なる。また、マイコン110は、主に、複数の共有リソース41、42を備えている点、監視コア10の処理動作がマイコン100と異なる。なお、図6では、各コア11〜14に対応して設けられたROM21〜23などの図示を省略している。
(Second embodiment)
The electronic control unit according to the second embodiment will be described with reference to FIGS. 6 to 8. The electronic control unit according to the present embodiment is different from the above-described embodiment in that it includes a microcomputer 110. The microcomputer 110 mainly includes a plurality of shared resources 41 and 42, and the processing operation of the monitoring core 10 is different from that of the microcomputer 100. In FIG. 6, the ROMs 21 to 23 provided corresponding to the cores 11 to 14 are not shown.

なお、本実施形態では、共有リソース41、42を第4コア14、及び、第4コア14に対応して設けられた第4逓倍器34を備えている例を採用している。第4コア14は、上記コア11〜13と同様に動作する。第4逓倍器34は、上記逓倍器31〜33と同様に、監視コア10によって設定された設定値に応じた周波数の動作クロックを第4コア14に供給する。しかしながら、本開示は、第4コア14及び第4逓倍器34を備えていないマイコン110であっても採用できる。 In this embodiment, the shared resources 41 and 42 include the fourth core 14 and the fourth multiplier 34 provided corresponding to the fourth core 14. The fourth core 14 operates similarly to the cores 11 to 13. The fourth multiplier 34, like the multipliers 31 to 33, supplies the fourth core 14 with an operation clock having a frequency according to the set value set by the monitoring core 10. However, the present disclosure can be adopted even for the microcomputer 110 that does not include the fourth core 14 and the fourth multiplier 34.

各共有リソース41、42は、共有リソース40と同様である。また、各スピンロック部51、52は、スピンロック部50と同様である。そして、監視コア10は、両スピンロック部51、52に格納されているスピンロック占有情報を確認可能に構成されている。 The shared resources 41 and 42 are similar to the shared resource 40. The spin lock units 51 and 52 are similar to the spin lock unit 50. Then, the monitoring core 10 is configured to be able to confirm the spin lock occupation information stored in both the spin lock units 51 and 52.

なお、図6では、第2共有リソース42は、第3コア13のみが使用可能に図示している。しかしながら、第2共有リソース42は、第1コア11、第2コア12、第4コア14が使用可能であってもよい。 Note that in FIG. 6, the second shared resource 42 is illustrated so that it can be used only by the third core 13. However, the second shared resource 42 may be usable by the first core 11, the second core 12, and the fourth core 14.

ここで、図7を用いて、監視コア10における高速化コア決定処理に関して説明する。監視コア10は、ステップS14で高速化するコアを決定する場合、図7のフローチャートで示す処理を実行する。 Here, the speed-up core determination process in the monitoring core 10 will be described with reference to FIG. 7. When determining the core to be accelerated in step S14, the monitoring core 10 executes the process shown in the flowchart of FIG.

まず、監視コア10は、ステップS30において、第1コア11が第1共有リソース41を占有しているか否かを判定する。そして、監視コア10は、第1コア11が第1共有リソース41を占有していると判定した場合は、ステップS31に進んで、第1コア11を高速化する対象とする。一方、監視コア10は、第1コア11が第1共有リソース41を占有していると判定しなかった場合は、ステップS32に進む。 First, in step S30, the monitoring core 10 determines whether the first core 11 occupies the first shared resource 41. When the monitoring core 10 determines that the first core 11 occupies the first shared resource 41, the monitoring core 10 proceeds to step S31 and sets the first core 11 as a target for speeding up. On the other hand, when the monitoring core 10 does not determine that the first core 11 occupies the first shared resource 41, the monitoring core 10 proceeds to step S32.

次に、監視コア10は、ステップS32において、第2コア12が第1共有リソース41を占有しているか否かを判定する。そして、監視コア10は、第2コア12が第1共有リソース41を占有していると判定した場合は、ステップS33に進んで、第2コア12を高速化する対象とする。一方、監視コア10は、第2コア12が第1共有リソース41を占有していると判定しなかった場合は、ステップS34に進む。 Next, the monitoring core 10 determines in step S32 whether the second core 12 occupies the first shared resource 41. When the monitoring core 10 determines that the second core 12 occupies the first shared resource 41, the monitoring core 10 proceeds to step S33 and sets the second core 12 as a target for speeding up. On the other hand, when the monitoring core 10 does not determine that the second core 12 occupies the first shared resource 41, the monitoring core 10 proceeds to step S34.

次に、監視コア10は、ステップS34において、第3コア13が第2共有リソース42を占有しているか否かを判定する。そして、監視コア10は、第3コア13が第2共有リソース42を占有していると判定した場合は、ステップS35に進んで、第3コア13を高速化する対象とする。一方、監視コア10は、第3コア13が第2共有リソース42を占有していると判定しなかった場合は、図7の処理を終了する。 Next, the monitoring core 10 determines in step S34 whether the third core 13 occupies the second shared resource 42. When the monitoring core 10 determines that the third core 13 occupies the second shared resource 42, the monitoring core 10 proceeds to step S35 and sets the third core 13 as a target for speeding up. On the other hand, when the monitoring core 10 does not determine that the third core 13 occupies the second shared resource 42, the monitoring core 10 ends the process of FIG. 7.

監視コア10は、占有コアの動作クロックを高速化している際に、他のコアが他の共有リソースを占有したとしても、他のコアの動作クロックを高速化しない(動作クロック管理部)。第3コア13は、第1共有リソース41ではなく、第2共有リソース42を使用する。よって、第3コア13は、第1コア11または第2コア12が第1共有リソース41を占有していたとしても、第2共有リソース42を占有することができる。同様に、第1コア11または第2コア12は、第3コア13が第2共有リソース42を占有していたとしても、第1共有リソース41を占有することができる。 The monitoring core 10 does not speed up the operation clocks of other cores even if the other cores occupy other shared resources while speeding up the operation clocks of the occupied cores (operation clock management unit). The third core 13 uses the second shared resource 42 instead of the first shared resource 41. Therefore, the third core 13 can occupy the second shared resource 42 even if the first core 11 or the second core 12 occupies the first shared resource 41. Similarly, the first core 11 or the second core 12 can occupy the first shared resource 41 even if the third core 13 occupies the second shared resource 42.

しかしながら、図8に示すように、監視コア10は、第1コア11または第2コア12の動作クロックを高速化している際に、第3コア13が第2共有リソース42を占有したとしても、第3コア13の動作クロックを高速化しない。同様に、監視コア10は、第3コア13の動作クロックを高速化している際に、第1コア11または第2コア12が第1共有リソース41を占有したとしても、第1共有リソース41を占有したコア(第1コア11または第2コア12)の動作クロックを高速化しない。 However, as shown in FIG. 8, in the monitoring core 10, even when the third core 13 occupies the second shared resource 42 while the operation clock of the first core 11 or the second core 12 is being accelerated, The operation clock of the third core 13 is not accelerated. Similarly, when the monitoring core 10 accelerates the operation clock of the third core 13, even if the first core 11 or the second core 12 occupies the first shared resource 41, The operating clock of the occupied core (first core 11 or second core 12) is not accelerated.

つまり、監視コア10は、先に共有リソースを占有しているコアの動作クロックを優先的に高速化する。言い換えると、監視コア10は、いずれの共有リソースも占有されていない状況で、あるコアが共有リソースを占有した場合に、そのコアの動作クロックを優先的に高速化する。このため、監視コア10は、あるコアが共有リソースを占有している場合、他のコアが他の共有リソースを占有したとしても、他のコアの動作クロックを高速化しない。 That is, the monitoring core 10 preferentially speeds up the operation clock of the core that has previously occupied the shared resource. In other words, the monitoring core 10 preferentially speeds up the operation clock of the core when a certain core occupies the shared resource in a situation where no shared resource is occupied. Therefore, when a certain core occupies a shared resource, the monitoring core 10 does not speed up the operation clock of the other core even if the other core occupies another shared resource.

このように、マイコン110は、複数のコア11〜13のうち、動作クロックを高速化するコアを一つとしている。これによって、マイコン110は、複数のコア(例えば第1コア11と第3コア13)の動作クロックを高速化することで消費電力が増大してしまうことを抑制できる。また、マイコン110は、消費電力の増大を抑制できるため、その分、発熱を抑える必要がある。 As described above, the microcomputer 110 has only one core that speeds up the operation clock among the plurality of cores 11 to 13. As a result, the microcomputer 110 can suppress an increase in power consumption by speeding up operation clocks of a plurality of cores (for example, the first core 11 and the third core 13). Further, since the microcomputer 110 can suppress an increase in power consumption, it is necessary to suppress heat generation accordingly.

(変形例)
ここで、図9を用いて、第2実施形態の変形例に関して説明する。変形例の監視コア10は、高速化コア決定処理が第2実施形態と異なる。監視コア10は、ステップS14で高速化するコアを決定する場合、図9のフローチャートで示す処理を実行する。
(Modification)
Here, a modification of the second embodiment will be described with reference to FIG. The modified monitoring core 10 differs from the second embodiment in the speed-up core determination process. When determining the core to be accelerated in step S14, the monitoring core 10 executes the process shown in the flowchart of FIG.

監視コア10は、ステップS40において、第1共有リソース41が占有されているか否かを判定する。そして、監視コア10は、第1共有リソース41が占有されていると判定した場合、ステップS41において、第1共有リソース41を占有しているコアを高速化する。この場合、監視コア10は、第1コア11と第2コア12のうちの第1共有リソース41を占有している方の動作クロックを高速化する。一方、監視コア10は、第1共有リソース41が占有されていると判定しなかった場合、ステップS42において、第2共有リソース42を占有しているコアを高速化する。この場合、監視コア10は、第3コア13の動作クロックを高速化する。変形例のマイコン110は、第2実施形態と同様の効果を奏することができる。 In step S40, the monitoring core 10 determines whether the first shared resource 41 is occupied. Then, when it is determined that the first shared resource 41 is occupied, the monitoring core 10 speeds up the core occupying the first shared resource 41 in step S41. In this case, the monitoring core 10 speeds up the operation clock of one of the first core 11 and the second core 12 that occupies the first shared resource 41. On the other hand, when the monitoring core 10 does not determine that the first shared resource 41 is occupied, the monitoring core 10 speeds up the core occupying the second shared resource 42 in step S42. In this case, the monitoring core 10 speeds up the operation clock of the third core 13. The modified microcomputer 110 can achieve the same effects as those of the second embodiment.

10…監視コア、11…第1コア、12…第2コア、13…第3コア、14…第4コア、21…第1ROM、22…第2ROM、23…第3ROM、31…第1逓倍器、32…第3逓倍器、33…第3逓倍器、34…第4逓倍器、40…共有リソース、41…第1共有リソース、42…第2共有リソース、50…スピンロック部、51…第1スピンロック部、52…第2スピンロック部、100,110…マイコン、200…発振器、310…第1映像演算装置、311…第2マイコン、320…第2映像演算装置、321…第3マイコン、400…表示装置 10... Monitoring core, 11... First core, 12... Second core, 13... Third core, 14... Fourth core, 21... First ROM, 22... Second ROM, 23... Third ROM, 31... First multiplier , 32... Third multiplier, 33... Third multiplier, 34... Fourth multiplier, 40... Shared resource, 41... First shared resource, 42... Second shared resource, 50... Spinlock unit, 51... 1 spin lock part, 52... 2nd spin lock part, 100, 110... Microcomputer, 200... Oscillator, 310... 1st image processing device, 311... 2nd microcomputer, 320... 2nd image processing device, 321... 3rd microcomputer , 400... Display device

Claims (6)

複数の処理部(11、12、13、14)と、
複数の前記処理部が使用可能な少なくとも一つの共有リソース(40、41、42)と、
各処理部の動作クロックを管理する動作クロック管理部(10、31、32、33、34)と、を備え、
各処理部は、前記共有リソースの使用権を獲得すると、前記使用権を解放するまでの間、他の前記処理部が前記共有リソースを使用できないように前記共有リソースを占有し、
前記動作クロック管理部は、複数の前記処理部のうち前記共有リソースを占有している占有処理部を検出するとともに、前記占有処理部の前記動作クロックを、前記共有リソースを占有していない場合よりも高速化する電子制御装置。
A plurality of processing units (11, 12, 13, 14),
At least one shared resource (40, 41, 42) usable by a plurality of the processing units;
An operation clock management unit (10, 31, 32, 33, 34) that manages the operation clock of each processing unit,
Each processing unit, when acquiring the usage right of the shared resource, occupies the shared resource so that the other processing units cannot use the shared resource until the usage right is released,
The operation clock management unit detects an occupation processing unit that occupies the shared resource from among the plurality of processing units, and sets the operation clock of the occupation processing unit to be less than that when the shared resource is not occupied. An electronic control unit that speeds up.
前記動作クロック管理部は、前記占有処理部の前記動作クロックを高速化している際に、低速化条件を満たすと判定した場合、前記占有処理部の前記動作クロックを低速化する請求項1に記載の電子制御装置。 The operation clock management unit slows down the operation clock of the occupancy processing unit if it is determined that the speed-down condition is satisfied while the operation clock of the occupancy processing unit is being speeded up. Electronic control unit. 前記動作クロック管理部は、前記占有処理部が前記使用権を解放した場合、前記低速化条件を満たしたと判定して、前記占有処理部の前記動作クロックを低速化する請求項2に記載の電子制御装置。 The electronic device according to claim 2, wherein the operation clock management unit, when the exclusive processing unit releases the usage right, determines that the speed-down condition is satisfied, and decreases the operation clock of the exclusive processing unit. Control device. 前記動作クロック管理部は、複数の前記処理部が前記共有リソースを占有していない状況が所定時間継続した場合、前記低速化条件を満たしたと判定して、前記占有処理部の前記動作クロックを低速化する請求項2に記載の電子制御装置。 When a plurality of the processing units do not occupy the shared resource for a predetermined time, the operation clock management unit determines that the speed reduction condition is satisfied, and the operation clock of the occupation processing unit is set to a low speed. The electronic control device according to claim 2, which is realized. 前記動作クロック管理部は、前記占有処理部を検出した場合、すべての処理部の前記動作クロックを低速化した後に、前記占有処理部の前記動作クロックのみを高速化する請求項1乃至4のいずれか1項に記載の電子制御装置。 5. The operation clock management unit, when detecting the occupancy processing unit, reduces the operation clocks of all the processing units and then speeds up only the operation clock of the occupancy processing unit. 2. The electronic control device according to item 1. 複数の前記共有リソースを備えており、
前記動作クロック管理部は、前記占有処理部の前記動作クロックを高速化している際に、他の前記処理部が他の前記共有リソースを占有したとしても、他の前記処理部の前記動作クロックを高速化しない請求項1乃至5のいずれか1項に記載の電子制御装置。
Comprising a plurality of said shared resources,
The operation clock management unit controls the operation clocks of the other processing units even when the other processing units occupy the other shared resources while increasing the operation clocks of the occupation processing units. The electronic control device according to claim 1, wherein the speed is not increased.
JP2019018880A 2019-02-05 2019-02-05 Electronic control device Pending JP2020126477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019018880A JP2020126477A (en) 2019-02-05 2019-02-05 Electronic control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019018880A JP2020126477A (en) 2019-02-05 2019-02-05 Electronic control device

Publications (1)

Publication Number Publication Date
JP2020126477A true JP2020126477A (en) 2020-08-20

Family

ID=72084039

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019018880A Pending JP2020126477A (en) 2019-02-05 2019-02-05 Electronic control device

Country Status (1)

Country Link
JP (1) JP2020126477A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022107246A1 (en) * 2020-11-18 2022-05-27 三菱電機株式会社 Control management device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022107246A1 (en) * 2020-11-18 2022-05-27 三菱電機株式会社 Control management device
JPWO2022107246A1 (en) * 2020-11-18 2022-05-27
JP7496891B2 (en) 2020-11-18 2024-06-07 三菱電機株式会社 Control Management Device

Similar Documents

Publication Publication Date Title
US20070118838A1 (en) Task execution controller, task execution control method, and program
US9760411B2 (en) Switching a locking mode of an object in a multi-thread program
WO2009113034A1 (en) Look-ahead task management
US20080295104A1 (en) Realtime Processing Software Control Device and Method
WO2011096163A1 (en) Information processing system, exclusive control method, and program for exclusive control
WO2016202154A1 (en) Gpu resource allocation method and system
WO2016202153A1 (en) Gpu resource allocation method and system
CN115658153A (en) Sleep lock optimization method and device, electronic equipment and storage medium
JP2020126477A (en) Electronic control device
JP4253796B2 (en) Computer and control method
JP2007172611A (en) Method and storage medium (effective use method for processor in virtual sharing environment)
US9223615B2 (en) Apparatus and method for thread progress tracking
JP2001117786A (en) Process scheduling device and process scheduling method
JP2006146758A (en) Computer system
JP2011175378A (en) Multiprocessor system and operation method for the same
US20200379820A1 (en) Synchronization mechanism for workgroups
JP2009075948A (en) Multicore processor
CN113127162B (en) Automatic task execution method and device, electronic equipment and computer storage medium
US20130067482A1 (en) Method for configuring an it system, corresponding computer program and it system
JP4441592B2 (en) Parallel processing apparatus and exclusive control method
JP5332716B2 (en) Startup control method, information processing apparatus, and program
JP6881116B2 (en) Information processing equipment, information processing methods and programs
JP2011248454A (en) Processor device and control method for processor device
JP2014078266A (en) Multi-core processor system, control method for multi-core processor system, and control program for multi-core processor system
US20220156074A1 (en) Electronic device and multiplexing method of spatial