JP2017130140A - Data processor - Google Patents
Data processor Download PDFInfo
- Publication number
- JP2017130140A JP2017130140A JP2016010668A JP2016010668A JP2017130140A JP 2017130140 A JP2017130140 A JP 2017130140A JP 2016010668 A JP2016010668 A JP 2016010668A JP 2016010668 A JP2016010668 A JP 2016010668A JP 2017130140 A JP2017130140 A JP 2017130140A
- Authority
- JP
- Japan
- Prior art keywords
- update
- task
- memory
- copy
- data
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/16—Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
- G06F15/163—Interprocessor communication
- G06F15/167—Interprocessor communication using a common memory, e.g. mailbox
Abstract
Description
本開示は、複数のプロセッサコアにおいて、データの更新と更新されたデータの参照とを異なるプロセッサコアが行う技術に関する。 The present disclosure relates to a technique in which different processor cores perform update of data and reference of updated data in a plurality of processor cores.
複数のプロセッサコアにおいて、データの更新と更新されたデータの参照とを異なるプロセッサコアが行う技術が知られている。
例えば、特許文献1に記載の技術では、複数のプロセッサコアとして2個のCPUコアのうち一方のCPUコアが生成タスクによりデータを生成して更新する処理が終了すると、他方のCPUコアに割り込みを要求するフラグを一方のCPUコアがセットする。
A technique is known in which, in a plurality of processor cores, different processor cores update data and reference updated data.
For example, in the technique described in
割り込み要求フラグがセットされると、他方のCPUコアに対する割り込みが起動されることにより、他方のCPUコアの取り込みタスクが起動される。他方のCPUコアが実行する取り込みタスクは、割り込み禁止レジスタに禁止フラグをセットすることにより、一方のCPUコアの生成タスクにより更新されたデータを取得して別のメモリに書き込む処理中、自CPUコアへの他の割り込み処理を禁止する。 When the interrupt request flag is set, an interrupt to the other CPU core is activated, and the fetch task of the other CPU core is activated. The fetching task executed by the other CPU core sets its prohibition flag in the interrupt prohibition register, thereby acquiring the data updated by the generation task of one CPU core and writing it to another memory. Disable other interrupt processing for.
他のCPUコアの取り込みタスクが一方のCPUコアの生成タスクが更新したデータを取得して別のメモリに書き込んでいる間、他のCPUコアへの割り込み処理が禁止されるので、取り込みタスクが書き込み中のデータは他のタスクにより参照されない。 While the capture task of another CPU core acquires the data updated by the generation task of one CPU core and writes it to another memory, interrupt processing to the other CPU core is prohibited, so the capture task writes The data inside is not referenced by other tasks.
取り込みタスクは、書き込みを終了すると割り込み禁止レジスタにセットされている禁止フラグをリセットするので、取り込みタスク以外の他のCPUコアのタスクは、取り込みタスクが書き込みを終了したデータを参照できる。これにより、特許文献1に記載の技術では、取り込みタスクによる書き込みタイミングの異なるデータを、他のCPUコアの他のタスクが参照することを防止しようとしている。
Since the capture task resets the prohibition flag set in the interrupt prohibition register when writing is completed, CPU core tasks other than the capture task can refer to the data for which the capture task has finished writing. As a result, the technique disclosed in
他のCPUコアの取り込みタスクは、取り込みタスクの処理中に自CPUコアへの割り込み処理を禁止するために割り込み禁止レジスタの禁止フラグをセットし、取り込みタスクの処理を終了すると禁止フラグをリセットする必要があるので、処理負荷が増加する。 The capture task of another CPU core needs to set the prohibit flag of the interrupt disable register to prohibit interrupt processing to the CPU core during the capture task processing, and reset the prohibit flag when the capture task processing ends. As a result, the processing load increases.
本開示の一側面は、処理負荷を極力低減して、第1プロセッサコアによる更新タイミングの異なるデータを第2プロセッサコアの参照タスクが参照することを抑制する技術を提供することを目的とする。 An object of one aspect of the present disclosure is to provide a technique that reduces processing load as much as possible and suppresses a reference task of a second processor core from referring to data having different update timings by a first processor core.
本開示の一態様は、一つの第1プロセッサコア(10)と、一つ以上の第2プロセッサコア(20、50、70)と、更新用メモリ(30)と、参照用メモリ(42、62、80)と、を備えている。 One aspect of the present disclosure includes one first processor core (10), one or more second processor cores (20, 50, 70), an update memory (30), and a reference memory (42, 62). , 80).
更新用メモリには、第1プロセッサコアが実行する更新タスク(12、S400〜S404)がデータを書き込む。
参照用メモリは第2プロセッサコア毎に設けられている。そして、第2プロセッサコアが実行する参照タスク(24、54、74、76、S430〜S434、S440〜S444)が参照用メモリを参照し、第2プロセッサコアが実行し参照タスクよりも優先度が高いコピータスク(22、52、72、S410〜S420、S450〜S460)が、更新用メモリから取得するデータを参照用メモリに書き込む。
The update task (12, S400 to S404) executed by the first processor core writes data in the update memory.
A reference memory is provided for each second processor core. The reference tasks (24, 54, 74, 76, S430 to S434, S440 to S444) executed by the second processor core refer to the reference memory, and the second processor core executes and has a higher priority than the reference task. The high copy task (22, 52, 72, S410 to S420, S450 to S460) writes the data acquired from the update memory to the reference memory.
この構成によれば、更新用メモリと参照用メモリとを別のメモリにしているので、参照タスクが参照用メモリのデータを参照中に更新タスクが更新用メモリのデータを更新しても、更新タスクは参照用メモリのデータを更新しない。 According to this configuration, since the update memory and the reference memory are separate memories, even if the update task updates the data in the update memory while the reference task is referring to the data in the reference memory, the update memory and the reference memory are updated. The task does not update the reference memory data.
さらに、第2プロセッサコアにおいて、コピータスクの優先度を参照タスクよりも高く設定しているので、参照タスクよりも優先度が高いコピータスクが更新用メモリから取得するデータを参照用メモリに書き込んでいる間、参照タスクは実行されない。 Further, since the priority of the copy task is set higher than that of the reference task in the second processor core, the data acquired from the update memory by the copy task having a higher priority than the reference task is written to the reference memory. The reference task is not executed while
したがって、参照タスクが参照する参照用メモリのデータを、更新タスクが同じタイミングで更新したデータをコピータスクが参照用メモリに書き込んだものにできる。
また、コピータスクと参照タスクとを実行する優先度は予め設定されているので、コピータスクの実行中に参照タスクの実行を禁止し、コピータスクの実行が終了すると参照タスクの実行を許可する処理を行う必要がない。これにより、処理負荷を極力低減して参照タスクの実行タイミングを調整できる。
Therefore, the data in the reference memory referred to by the reference task can be changed to the data updated by the update task at the same timing and written in the reference memory by the copy task.
In addition, since the priority for executing the copy task and the reference task is set in advance, the execution of the reference task is prohibited during the execution of the copy task, and the execution of the reference task is permitted when the execution of the copy task is completed. There is no need to do. Thereby, it is possible to adjust the execution timing of the reference task while reducing the processing load as much as possible.
このように、処理負荷を極力低減して、第1プロセッサコアによる更新タイミングの異なるデータを第2プロセッサコアの参照タスクが参照することを抑制できる。
尚、この欄および特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本発明の技術的範囲を限定するものではない。
In this way, it is possible to reduce the processing load as much as possible, and to prevent the reference task of the second processor core from referring to data having different update timings by the first processor core.
Note that the reference numerals in parentheses described in this column and in the claims indicate the correspondence with the specific means described in the embodiment described later as one aspect, and the technical scope of the present invention. It is not limited.
以下、本発明が適用された実施形態を図に基づいて説明する。
[1.第1実施形態]
[1−1.構成]
図1に示す第1実施形態のデータ処理装置2は、2個のプロセッサコア10、20と、更新用RAM30と、更新開始カウンタ32と、更新終了カウンタ34と、一時格納用RAM40と、参照用RAM42と、参照中フラグ44と、図示しないROMおよびフラッシュメモリ等を備えている。データ処理装置2は、2個のコア10、20を備えるマルチコアプロセッサである。以下、プロセッサコアを単に「コア」とも言う。
Embodiments to which the present invention is applied will be described below with reference to the drawings.
[1. First Embodiment]
[1-1. Constitution]
The
データ処理装置2の各機能は、コア10、20がROMまたはフラッシュメモリ等の非遷移的実体的記録媒体に記憶されているプログラムを実行することにより実現される。このプログラムが実行されることにより、プログラムに対応する方法が実行される。データ処理装置2の各機能を実現する手法は、ソフトウェアに限るものではなく、その一部または全部の要素を、論理回路やアナログ回路等を組み合わせたハードウェアを用いてもよい。
Each function of the
第1プロセッサコアに対応するコア10は、更新タスク12を実行して更新用RAM30のデータを更新する。更新タスク12は、更新用RAM30のデータに対する更新を開始するときに更新開始カウンタ32の値を1増加し、更新用RAM30のデータに対する更新を終了するときに更新終了カウンタ34の値を1増加する。更新開始カウンタ32と更新終了カウンタ34との初期値は例えば0のように同じ値に設定されている。
The
つまり、更新開始カウンタ32と更新終了カウンタ34とは、更新タスク12が更新用RAM30のデータを更新していないときには同じ値であり、更新タスク12が更新用RAM30のデータを更新中には異なる値である。
That is, the update start
更新タスク12は、更新開始カウンタ32と更新終了カウンタ34とを1増加する代わりに、1減少してもよい。つまり、更新開始カウンタ32の値と更新終了カウンタ34の値とは、増加または減少の同じ方向に変化する。また、更新開始カウンタ32と更新終了カウンタ34との増減量は、同じであれば1に限るものではない。
Instead of incrementing the update start
コア10は、コア20が実行するコピータスク22と参照タスク24とが実行中であるか否かに関わらず、更新タスク12を実行する。
第2プロセッサコアに対応するコア20は、コピータスク22と参照タスク24とを実行する。コピータスク22を実行する優先度は参照タスク24を実行する優先度よりも高い。コピータスク22は、コア10が更新タスクを実行していない場合、更新用RAM30のデータを取得して一時格納用RAM40に一時的に格納する。
The
The
コピータスク22は、更新用RAM30のデータを取得して一時格納用RAM40に格納している間に更新タスク12が更新用RAM30のデータを更新しない場合、一時格納用RAM40に格納した更新用RAM30のデータを参照用RAM42に書き込む。
When the
参照タスク24は、参照用RAM42のデータを参照する。参照タスク24は、参照用RAM42のデータを参照中、参照中フラグ44の値を、参照中であるオン状態であることを示す値として例えば1に設定する。参照タスク24は、参照用RAM42のデータの参照を終了すると、参照中フラグ44の値を、参照中ではないオフ状態であることを示す値として例えば0に設定する。
The
参照タスク24よりも優先度の高いコピータスク22は、参照中フラグ44が1に設定されている場合、更新用RAM30のデータを取得して参照用RAM42に書き込むコピー処理を実行しない。
When the
[1−2.処理]
(1)更新処理
図2に示す更新処理は、更新用RAM30のデータを更新する更新タイミングになると更新タスク12により実行される。図2のS400において更新タスク12は、更新開始カウンタ32を+1する。S402において更新タスク12は、更新用RAM30のデータを更新する。更新用RAM30のデータの更新が終了すると、S404において更新タスク12は、更新終了カウンタ34の値を+1する。
[1-2. processing]
(1) Update Process The update process shown in FIG. 2 is executed by the
(2)コピー処理
図3に示すコピー処理は、更新用RAM30のデータを取得して参照用RAM42に書き込むタイミングになるとコピータスク22により実行される。図3のS410においてコピータスク22は、参照中フラグ44がオンであるか否かを判定する。
(2) Copy Process The copy process shown in FIG. 3 is executed by the
S410の判定がYesであり、参照中フラグ44がオンの場合、参照タスク24が参照用RAM42を参照中であることを表している。この場合、参照タスク24が参照用RAM42を参照中にコピータスク22が更新用RAM30のデータを取得して参照用RAM42に書き込むことを抑制するために、コピータスク22は本処理を終了する。
If the determination in S410 is Yes and the
S410の判定がNoであり、参照タスク24が参照用RAM42を参照中ではない場合、S412においてコピータスク22は、更新開始カウンタ32の値と更新終了カウンタ34の値とが一致しているか否かを判定する。
If the determination in S410 is No and the
例えば、図4に示すように、更新開始カウンタ32の値と更新終了カウンタ34の値とが「4」で等しくS412の判定がYesの場合、コピータスク22は、更新タスク12が更新用RAM30のデータを更新中ではないと判断する。この場合、コピータスク22はS414に処理を移行する。
For example, as shown in FIG. 4, when the value of the update start counter 32 and the value of the update end counter 34 are “4” and the determination in S 412 is Yes, the
尚、図4において4種類の実行タイミングで実行されるコピー処理は、各タイミングでそれぞれ実行されるのではなく、4種類の実行タイミングのうちいずれかのタイミングで実行される。 In FIG. 4, the copy process executed at four types of execution timing is not executed at each timing, but is executed at any one of the four types of execution timing.
更新開始カウンタ32の値が「5」であり、更新終了カウンタ34の値が「4」であるためにS412の判定がNoの場合、コピータスク22は、更新タスク12が更新用RAM30のデータを更新中であると判断する。
When the value of the update start counter 32 is “5” and the value of the
この場合、コピータスク22は、更新開始カウンタ32の値と更新終了カウンタ34の値とが「5」になり等しくなるまで待機する。そして、更新開始カウンタ32の値と更新終了カウンタ34の値とが「5」になると、更新タスク12による更新用RAM30のデータの更新が終了したと判断し、コピータスク22はS414に処理を移行する。
In this case, the
S414においてコピータスク22は、更新開始カウンタ32の値を一時格納用RAM40等の一時記憶エリアに退避する。
S416においてコピータスク22は、更新用RAM30から取得したデータを一時格納用RAM40に格納する。更新用RAM30のデータの一時格納用RAM40への格納が終了すると、S418においてコピータスク22は、S414において一時記憶エリアに退避していた更新開始カウンタ32の値と現在の更新開始カウンタ32の値とが一致しているか否かを判定する。
In S <b> 414, the
In S 416, the
S418の判定がNoであり、一時記憶エリアに退避していた更新開始カウンタ32の値と現在の更新開始カウンタ32の値とが異なる場合、コピータスク22は、更新用RAM30のデータを一時格納用RAM40に格納中に、コア10の更新タスク12が更新用RAM30のデータを更新したと判断する。
If the determination in S418 is No and the value of the update start counter 32 saved in the temporary storage area is different from the current value of the update start counter 32, the
この場合、コピータスク22が一時格納用RAM40に格納した更新用RAM30のデータには、更新タスク12による更新前と更新後とのデータが混在している可能性がある。この状態では、一時格納用RAM40に格納した更新用RAM30のデータに更新タイミングの異なるデータが混在し、データの同時性が確保できないので、コピータスク22はS412に処理を移行してコピー処理を再実行する。
In this case, the data in the
S418の判定がYesであり、一時記憶エリアに退避していた更新開始カウンタ32の値と現在の更新開始カウンタ32の値とが一致する場合、コピータスク22は、一時格納用RAM40に格納した更新用RAM30のデータの同時性が確保されていると判断する。そこで、S420においてコピータスク22は、一時格納用RAM40に格納した更新用RAM30のデータを参照用RAM42に書き込む。
If the determination in S418 is Yes and the value of the update start counter 32 saved in the temporary storage area matches the current value of the update start counter 32, the
(3)参照処理
図5に示す参照処理は、参照タスク24が参照用RAM42を参照するタイミングになり、参照タスク24よりも優先度の高いコピータスク22が実行中ではない場合に実行される。図5のS430において参照タスク24は、参照中フラグ44をオンに設定する。参照中フラグ44がオンに設定されることにより、コピータスク22はコピー処理を実行しない。S432において参照タスク24は参照用RAM42のデータを参照する。
(3) Reference Process The reference process shown in FIG. 5 is executed when the
ここで、図6に示すように、コピータスク22が更新用RAM30から変数A、B、Cを取得して参照用RAM42の変数a、b、cに書き込み、参照タスク24が次式(1)からXを算出する場合を例にして、各タスクの実行タイミングを説明する。尚、図6において、式(1)から算出されるXの値は四捨五入されている。
Here, as shown in FIG. 6, the
X=(a+b+c)/3 ・・・(1)
最初、更新用RAM30の変数A、B、Cには、それぞれ10、15、45が設定されている。図6に示す(1)のタイミングでコピータスク22が実行されることにより、参照用RAM42の変数a、b、cにそれぞれ10、15、45が書き込まれる。コピータスク22の実行終了後、(2)のタイミングで参照タスク24は、参照用RAM42の変数a、b、cを参照し、式(1)からX=23を算出する。
X = (a + b + c) / 3 (1)
Initially, the variables A, B, and C of the
(3)のタイミングでコピータスク22が実行されても、更新用RAM30の変数A、B、Cの値が更新されていないので、参照用RAM42の変数a、b、cの値は変化しない。
Even if the
(4)のタイミングで参照タスク24が実行されても、参照用RAM42の変数a、b、cの値が変化していないので、X=23のままである。参照タスク24が実行されている途中の(5)のタイミングで更新タスク12が実行され、更新用RAM30の変数A、B、Cの値が20、30、29に更新されても、コピータスク22が実行されないので、参照用RAM42の変数a、b、cの値は変化しない。
Even if the
(5)のタイミングで更新タスク12が実行され、(6)のタイミングでコピータスク22が実行されることにより、参照用RAM42の変数a、b、cに20、30、29が書き込まれる。
The
(7)のタイミングで更新タスク12が実行され、更新タスク12が実行されている途中の(8)のタイミングで参照タスク24が実行されても、コピータスク22が実行されないので、参照用RAM42の変数a、b、cの値は20、30、29のままである。したがって、参照タスク24は式(1)からX=26を算出する。
Even if the
(7)のタイミングで更新タスク12が実行されてから、(9)のタイミングでコピータスク22が実行されることにより、参照用RAM42の変数a、b、cに30、22、8が書き込まれる。
After the
(10)のタイミングでコピータスク22が実行されても、その前に更新タスク12が実行されていないので、参照用RAM42の変数a、b、cの値は30、22、8のままである。(11)のタイミングで参照タスク24は、式(1)からX=20を算出する。
Even if the
次に、S432において参照用RAM42のデータを参照すると、S434において参照タスク24は、参照中フラグ44をオフに設定する。これにより、コピータスク22の実行が可能になる。
Next, referring to the data in the
[1−3.効果]
以上説明した第1実施形態によれば、以下の効果を得ることができる。
(1)更新タスク12がデータを更新する更新用RAM30と、参照タスク24が参照する参照用RAM42とを別のメモリにした。これにより、更新タスク12が更新用RAM30のデータを更新しても、更新タスク12は参照用RAM42のデータを更新しない。そして、参照タスク24よりも優先度が高いコピータスク22が更新用RAM30から参照用RAM42にデータを書き込んでいる間、参照タスク24は実行されない。
[1-3. effect]
According to the first embodiment described above, the following effects can be obtained.
(1) The
したがって、更新タスク12と参照タスク24とが重複して実行されても、更新タスク12による更新タイミングの異なる更新用RAM30のデータを、参照タスク24が参照用RAM42から参照することを抑制できる。
Therefore, even if the
(2)コピータスク22と参照タスク24とを実行する優先度は予め設定されているので、コピータスク22の実行中に参照タスク24の実行を禁止し、コピータスク22の実行が終了すると参照タスク24の実行を許可する処理を行う必要がない。これにより、処理負荷を極力低減して参照タスク24の実行タイミングを調整できる。
(2) Since the priority of executing the
(3)更新開始カウンタ32の値と更新終了カウンタ34の値とを比較することにより、更新タスク12が更新用RAM30のデータを更新中であれば、コピータスク22は更新用RAM30のデータを一時格納用RAM40に格納しない。
(3) If the
さらに、更新開始カウンタ32の値の変化に基づいて、コピータスク22が一時格納用RAM40にデータを格納中に更新タスク12がデータを更新したと判定すると、コピータスク22は一時格納用RAM40のデータを参照用RAM42に書き込まない。
Further, when it is determined that the
このように、更新開始カウンタ32の値と更新終了カウンタ34の値とに基づいて、処理負荷を極力低減して、更新タスク12による更新タイミングの異なるデータをコピータスク22が参照用RAM42に書き込むことを抑制できる。
As described above, the
(4)参照中フラグ44を設定することにより、処理負荷を極力低減して、参照タスク24の実行中にコピータスク22の実行を禁止できる。
(5)更新開始カウンタ32の値と更新終了カウンタ34の値の設定、ならびにコピータスク22と参照タスク24との予め設定された優先度、ならびに参照中フラグ44の設定により、コピータスク22と参照タスク24との実行タイミングが調整される。
(4) By setting the
(5) Refer to the
割り込み処理により調整する場合に比べ、コピータスク22と参照タスク24との実行タイミングの調整に要する処理負荷を極力低減できる。さらに、コピータスク22と参照タスク24との実行タイミングを調整するための処理部が不要である。
Compared with the case where adjustment is performed by interrupt processing, the processing load required for adjusting the execution timing of the
[2.第2実施形態]
[2−1.構成]
図7に示す第2実施形態のデータ処理装置4は、第1実施形態のデータ処理装置2に対し、さらにコア50と、一時格納用RAM60と、参照用RAM62と、参照中フラグ64とを備えている。つまり、参照タスク24、54毎に、参照中フラグ44、64がそれぞれ備えられている。
[2. Second Embodiment]
[2-1. Constitution]
The
尚、第2実施形態において第1実施形態と同じ符号は同一の構成を示すものであって、詳細については先行する説明を参照するものとする。
第2プロセッサコアに対応するコア50は、コア20と同様にコピータスク52と参照タスク54とを実行する。コピータスク52が実行するコピー処理は、コピータスク22が実行するコピー処理と実質的に同一である。参照タスク54が実行する参照処理は、参照タスク24が実行する参照処理と実質的に同一である。
In the second embodiment, the same reference numerals as those in the first embodiment indicate the same configuration, and the preceding description will be referred to for details.
The core 50 corresponding to the second processor core executes the
一時格納用RAM40と一時格納用RAM60、参照用RAM42と参照用RAM62、参照中フラグ44と参照中フラグ64のそれぞれの機能は実質的に同一である。
そして、コア20とコア50とはそれぞれ独立してコア毎にタスクを実行する。
The functions of the
The
[2−2.効果]
データ処理装置4が第2プロセッサコアとして2個のコア20、50を備えても、コア10とコア20、ならびにコア10とコア50との関係において、第1実施形態の効果(1)〜(5)と同様の効果を得ることができる。
[2-2. effect]
Even if the
[3.第3実施形態]
[3−1.構成]
図8に示す第3実施形態のデータ処理装置6では、第1実施形態の参照中フラグ44に代えて参照中カウンタ82を備え、コア20に代えてコア70を備えている。参照用RAM80は第1実施形態の参照用RAM42に対応する。
[3. Third Embodiment]
[3-1. Constitution]
In the
尚、第3実施形態において第1実施形態と同じ符号は同一の構成を示すものであって、詳細については先行する説明を参照するものとする。
コア70は、コピータスク72と、2個の参照タスク74、76とを実行する。コピータスク72の優先度は参照タスク74、76の優先度よりも高い。参照タスク74の優先度は参照タスク76の優先度よりも高い。コピータスク72が実行するコピー処理は、コピータスク22が実行するコピー処理と実質的に同一である。参照タスク74、76が実行する参照処理は、参照したデータの処理内容が異なっている。
In the third embodiment, the same reference numerals as those in the first embodiment indicate the same configuration, and the preceding description will be referred to for details.
The
[3−2.処理]
(1)参照処理
図9に示す参照処理は、参照タスク74、76が参照用RAM80を参照するタイミングになり、コピータスク72が実行中ではない場合に実行される。参照タスク76よりも優先度の高い参照タスク74が実行中は、参照タスク76は実行されない。
[3-2. processing]
(1) Reference Process The reference process shown in FIG. 9 is executed when the
図9のS440において参照タスク74、76は、参照中カウンタ82の値を+1する。参照中カウンタ82の初期値は例えば0である。
参照中カウンタ82の値が0ではない場合、参照タスク74、76のいずれかが参照用RAM80を参照していることを表している。この場合、コピータスク72はコピー処理を実行しない。
In S440 of FIG. 9, the
When the value of the
参照タスク76が実行中に参照タスク76よりも優先度の高い参照タスク74が起動されると、参照中カウンタ82の値は+1されて2になる。
S442において参照タスク74、76は、参照用RAM80のデータを参照する。参照用RAM80のデータの参照が終了すると、S444において参照タスク74、76は参照中カウンタ82を−1する。
When the
In S442, the
(2)コピー処理
図10に示すコピー処理は、更新用RAM30のデータを参照用RAM80にコピーするタイミングになるとコピータスク72により実行される。図10のS450においてコピータスク72は、参照中カウンタ82が0であるか否かを判定する。
(2) Copy Process The copy process shown in FIG. 10 is executed by the
S450の判定がNoであり、参照中カウンタ82の値が0ではない場合、参照タスク74、76の少なくとも一方が参照用RAM80を参照中であることを表している。この場合、参照タスク74、76が参照用RAM80を参照中にコピータスク72が更新用RAM30のデータを取得して参照用RAM80に書き込むことを抑制するために、コピータスク72は本処理を終了する。
When the determination in S450 is No and the value of the
S450の判定がYesであり、参照タスク74、76のいずれも参照用RAM80を参照中ではない場合、コピータスク72はS452〜S460の処理を実行する。S452〜S460の処理は、第1実施形態のS412〜S420の処理と実質的に同一であるから説明を省略する。
When the determination in S450 is Yes and neither of the
[3−3.効果]
以上説明した第3実施形態では、第1実施形態の効果(1)〜(5)において参照中フラグ44を参照中カウンタ82に代えて得られる効果に加え、以下の効果を得ることができる。
[3-3. effect]
In the third embodiment described above, in addition to the effects obtained by replacing the
参照中カウンタ82の値を参照タスク74、76のそれぞれが増加および減少することにより、コア70が複数の参照タスク74、76を実行しても、参照タスク74、76の少なくともいずれかが実行中であることを容易に判定できる。
Even if the
[4.第4実施形態]
[4−1.構成]
図11に示す第4実施形態のデータ処理装置8は、第1実施形態のデータ処理装置2に対し、さらに第3実施形態で説明したコア70と、コア70に対応して、一時格納用RAM84と、参照用RAM80と、参照中カウンタ82とを備えている。一時格納用RAM84と、参照用RAM80と、参照中カウンタ82は、第3実施形態の一時格納用RAM40と、参照用RAM80と、参照中カウンタ82とに対応している。
[4. Fourth Embodiment]
[4-1. Constitution]
The
尚、第4実施形態において第1実施形態および第3実施形態と同じ符号は同一の構成を示すものであって、詳細については先行する説明を参照するものとする。
そして、コア20とコア70とはそれぞれ独立してコア毎にタスクを実行する。
In addition, in 4th Embodiment, the same code | symbol as 1st Embodiment and 3rd Embodiment shows the same structure, Comprising: The previous description shall be referred for the detail.
The
[4−2.効果]
データ処理装置8が第2プロセッサコアとして2個のコア20、70を備え、コア70が優先度の異なる2個の参照タスク74、76を実行する。したがって、第2実施形態と第3実施形態とを合わせた効果を得ることができる。
[4-2. effect]
The
以上説明した上記実施形態において、コア10が第1プロセッサコアに対応し、コア20、50、70が第2プロセッサコアに対応する。さらに、更新用RAM30が更新用メモリに対応し、一時格納用RAM40、60、84が一時格納用メモリに対応し、参照用RAM42、62、80が参照用メモリに対応する。
In the above-described embodiment, the
また、上記実施形態において、S400〜S404が更新タスク12としての処理に対応し、S410〜S420がコピータスク22としての処理に対応し、S430〜S432が参照タスク24としての処理に対応し、S440〜S444が参照タスク74、76としての処理に対応し、S450〜S460がコピータスク72としての処理に対応する。
In the above embodiment, S400 to S404 correspond to processing as the
[5.他の実施形態]
(1)上記実施形態では、データ処理装置が複数の第2プロセッサコアを備える場合、2個の第2プロセッサコアを例示した。これに対し、データ処理装置が備える複数の第2プロセッサコアは3個以上でもよい。
[5. Other Embodiments]
(1) In the above embodiment, when the data processing apparatus includes a plurality of second processor cores, two second processor cores are exemplified. On the other hand, the number of the second processor cores included in the data processing device may be three or more.
(2)上記実施形態では、コピータスクが更新用RAM30のデータを一時格納用RAMに格納する前か、一時格納用RAMに格納中に更新タスク12が更新用RAM30のデータを更新すると、コピータスクはコピー処理を再実行する。
(2) In the above embodiment, when the copy task updates the data in the
これに対し、コピータスクが更新用RAM30のデータを一時格納用RAMに格納する前か一時格納用RAMに格納中に更新タスク12が更新用RAM30のデータを更新すると、コピータスクは今回のコピー処理を終了してもよい。
On the other hand, when the
(3)上記第3実施形態では、参照タスク74、76の少なくともいずれかが参照用RAM42を参照中であるか否かを参照中カウンタ82の値を増加および減少することにより表した。これに対し、参照用RAM42を参照中であるか否かを表す参照中フラグを参照タスク74、76のそれぞれに設けてもよい。
(3) In the third embodiment, whether or not at least one of the
(4)上記第3実施形態では、第2プロセッサコアに対応するコア70は、優先度の異なる2個の参照タスク74、76を実行した。これに対し、一つの第2プロセッサコアが、複数の参照タスクとして優先度の異なる3個以上の参照タスクを実行してもよい。
(4) In the third embodiment, the core 70 corresponding to the second processor core executes the two
(5)上記第3実施形態では、第2プロセッサコアに対応する一つのコア70が優先度の異なる2個の参照タスク74、76を実行した。これに対し、2個以上の第2プロセッサコアが優先度の異なる複数の参照タスクを実行してもよい。この場合、複数の参照タスクを実行する第2プロセッサ毎に参照中カウンタが備えられる。
(5) In the third embodiment, one
(6)上記実施形態における一つの構成要素が有する複数の機能を複数の構成要素によって実現したり、一つの構成要素が有する一つの機能を複数の構成要素によって実現したりしてもよい。また、複数の構成要素が有する複数の機能を一つの構成要素によって実現したり、複数の構成要素が有する一つの機能を一つの構成要素によって実現したりしてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加または置換してもよい。尚、特許請求の範囲に記載した文言のみによって特定される技術思想に含まれるあらゆる態様が本発明の実施形態である。 (6) A plurality of functions of one constituent element in the above embodiment may be realized by a plurality of constituent elements, or a single function of one constituent element may be realized by a plurality of constituent elements. Further, a plurality of functions possessed by a plurality of constituent elements may be realized by one constituent element, or a single function possessed by a plurality of constituent elements may be realized by one constituent element. Moreover, you may abbreviate | omit a part of structure of the said embodiment. Further, at least a part of the configuration of the above embodiment may be added to or replaced with the configuration of the other embodiment. In addition, all the aspects included in the technical idea specified only by the wording described in the claims are embodiments of the present invention.
(7)上述したデータ処理装置の他、当該データ処理装置としてコンピュータを機能させるためのデータ処理プログラム、このデータ処理プログラムを記録した記録媒体、データ処理方法など、種々の形態で本発明を実現することもできる。 (7) In addition to the data processing apparatus described above, the present invention is realized in various forms such as a data processing program for causing a computer to function as the data processing apparatus, a recording medium on which the data processing program is recorded, and a data processing method. You can also.
2〜8:データ処理装置、10:コア(第1プロセッサコア)、12:更新タスク、20、50、70:コア(第2プロセッサコア)、22、52、72:コピータスク、24、54、74、76:参照タスク、30:更新用RAM(更新用メモリ)、32:更新開始カウンタ、34:更新終了カウンタ、40、60、84:一時格納用RAM(一時格納用メモリ)、42、62、80:参照用RAM(参照用メモリ)、44、64:参照中フラグ、82:参照中カウンタ 2-8: Data processing device, 10: Core (first processor core), 12: Update task, 20, 50, 70: Core (second processor core), 22, 52, 72: Copy task, 24, 54, 74, 76: Reference task, 30: Update RAM (update memory), 32: Update start counter, 34: Update end counter, 40, 60, 84: Temporary storage RAM (temporary storage memory), 42, 62 80: Reference RAM (reference memory) 44, 64: Referenced flag 82: Referenced counter
Claims (8)
一つ以上の第2プロセッサコア(20、50、70)と、
前記第1プロセッサコアが実行する更新タスク(12、S400〜S404)がデータを書き込む更新用メモリ(30)と、
前記第2プロセッサコア毎に設けられ、前記第2プロセッサコアが実行する少なくとも一つの参照タスク(24、54、74、76、S430〜S434、S440〜S444)が参照し、前記第2プロセッサコアが実行し前記参照タスクよりも優先度の高いコピータスク(22、52、72、S410〜S420、S450〜S460)が前記更新用メモリから取得するデータを書き込む参照用メモリ(42、62、80)と、
を備えるデータ処理装置(2、4、6、8)。 One first processor core (10);
One or more second processor cores (20, 50, 70);
An update memory (30) in which the update task (12, S400 to S404) executed by the first processor core writes data;
At least one reference task (24, 54, 74, 76, S430 to S434, S440 to S444) provided by each second processor core and executed by the second processor core refers to the second processor core. A reference memory (42, 62, 80) for writing data acquired from the update memory by a copy task (22, 52, 72, S410 to S420, S450 to S460) that is executed and has a higher priority than the reference task; ,
A data processing device (2, 4, 6, 8).
少なくとも一つの前記第2プロセッサコア(20、50)が一つの前記参照タスク(24、54)を実行する場合、前記参照タスクが前記参照用メモリを参照中であることを示す参照中フラグ(44、64)を前記参照タスク毎にさらに備え、
前記コピータスク(S410)は、前記参照タスクが前記参照用メモリを参照中であることを前記参照中フラグが示している場合、前記更新用メモリのデータを取得して前記参照用メモリに書き込むコピー処理を実行せず、
少なくとも一つの前記第2プロセッサコア(70)が複数の前記参照タスク(74、76)を実行する場合、複数の前記参照タスクを実行する前記第2プロセッサコア毎に、複数の前記参照タスクが増加および減少させる参照中カウンタ(82)をさらに備え、
複数の前記参照タスク(S440、S444)は、前記参照用メモリ(80)の参照を開始するときに前記参照中カウンタの増加または減少の一方を実行し、前記参照用メモリの参照を終了するときに前記参照中カウンタの増加または減少の他方を実行し、
前記コピータスク(72、S450)は、前記参照タスクが前記参照用メモリを参照中であることを前記参照中カウンタが示している場合、前記更新用メモリのデータを取得して前記参照用メモリに書き込むコピー処理を実行しない、
データ処理装置。 The data processing apparatus according to claim 1,
When at least one second processor core (20, 50) executes one reference task (24, 54), a reference flag (44) indicating that the reference task is referring to the reference memory 64) for each reference task,
The copy task (S410) obtains data in the update memory and writes to the reference memory when the reference flag indicates that the reference task is referring to the reference memory Do not execute the process,
When at least one second processor core (70) executes a plurality of reference tasks (74, 76), the plurality of reference tasks increases for each second processor core that executes the plurality of reference tasks. And a decrementing reference counter (82),
The plurality of reference tasks (S440, S444) execute one of incrementing or decrementing of the reference counter when starting the reference of the reference memory (80), and ending the reference of the reference memory The other of the incrementing or decrementing of the reference counter
When the reference counter indicates that the reference task is referring to the reference memory, the copy task (72, S450) acquires data in the update memory and stores it in the reference memory. Do not execute the copy process to write,
Data processing device.
前記第2プロセッサコア(20、50)が実行する少なくとも一つの前記参照タスク(24、54)が前記参照用メモリを参照中であることを示す参照中フラグ(44、64)を前記参照タスク毎にさらに備え、
前記コピータスク(S410)は、前記参照タスクが前記参照用メモリを参照中であることを前記参照中フラグが示している場合、前記更新用メモリのデータを取得して前記参照用メモリに書き込むコピー処理を実行しない、
データ処理装置。 The data processing apparatus according to claim 1,
A reference flag (44, 64) indicating that at least one reference task (24, 54) executed by the second processor core (20, 50) is referring to the reference memory is set for each reference task. In addition,
The copy task (S410) obtains data in the update memory and writes to the reference memory when the reference flag indicates that the reference task is referring to the reference memory Do not perform processing,
Data processing device.
前記更新用メモリに書き込みを開始するときに前記更新タスクが増加または減少させる更新開始カウンタ(32)と、
前記更新用メモリへの書き込みを終了するときに前記更新タスクが前記更新開始カウンタと同一方向に増加または減少させる更新終了カウンタ(34)と、
をさらに備え、
前記コピータスク(S412、S452)は、前記更新開始カウンタと前記更新終了カウンタとの値に基づいて前記更新タスクが前記更新用メモリへの書き込み中であると判定すると、前記更新用メモリのデータを取得して前記参照用メモリに書き込むコピー処理を再実行する、
データ処理装置。 In the data processing device according to any one of claims 1 to 3,
An update start counter (32) that causes the update task to increase or decrease when writing to the update memory is started;
An update end counter (34) that causes the update task to increase or decrease in the same direction as the update start counter when writing to the update memory is terminated;
Further comprising
When the copy task (S412, S452) determines that the update task is writing to the update memory based on the values of the update start counter and the update end counter, the copy task stores the data in the update memory. Re-execute the copy process of acquiring and writing to the reference memory;
Data processing device.
前記コピータスク(S418、S458)は、前記コピー処理の実行中に、前記更新開始カウンタの値が変化すると前記更新タスクが前記更新用メモリに書き込んだと判定し、前記コピー処理を再実行する、
データ処理装置。 The data processing apparatus according to claim 4, wherein
The copy task (S418, S458) determines that the update task has written in the update memory when the value of the update start counter changes during execution of the copy process, and re-executes the copy process.
Data processing device.
前記更新用メモリに書き込みを開始するときに前記更新タスクが増加または減少させる更新開始カウンタ(32)と、
前記更新用メモリへの書き込みを終了するときに前記更新タスクが前記更新開始カウンタと同一方向に増加または減少させる更新終了カウンタ(34)と、
をさらに備え、
前記コピータスクは、前記更新開始カウンタと前記更新終了カウンタとの値に基づいて前記更新タスクが前記更新用メモリへの書き込み中であると判定すると、前記更新用メモリのデータを取得して前記参照用メモリに書き込むコピー処理を終了する、
データ処理装置。 In the data processing device according to any one of claims 1 to 3,
An update start counter (32) that causes the update task to increase or decrease when writing to the update memory is started;
An update end counter (34) that causes the update task to increase or decrease in the same direction as the update start counter when writing to the update memory is terminated;
Further comprising
When the copy task determines that the update task is writing to the update memory based on the values of the update start counter and the update end counter, the copy task acquires data of the update memory and references the End the copy process to write to the memory
Data processing device.
前記コピータスクは、前記コピー処理の実行中に、前記更新開始カウンタの値が変化すると前記更新タスクが前記更新用メモリに書き込んだと判定して前記コピー処理を終了する、
データ処理装置。 The data processing apparatus according to claim 6, wherein
When the value of the update start counter changes during execution of the copy process, the copy task determines that the update task has written to the update memory and ends the copy process.
Data processing device.
前記コピータスクが前記更新用メモリから取得するデータを一時的に格納する一時格納用メモリ(40、60、84)をさらに備え、
前記コピータスク(S416、S456)は、前記参照タスクが前記参照用メモリを参照中ではなく、かつ前記更新タスクが前記更新用メモリを更新中ではなく、かつ前記コピータスクが前記更新用メモリから取得するデータを前記一時格納用メモリに格納中に前記更新タスクが前記更新用メモリを更新していない場合、前記一時格納用メモリに格納した前記更新用メモリのデータを前記参照用メモリに書き込む、
データ処理装置。 In the data processing device according to any one of claims 1 to 7,
A temporary storage memory (40, 60, 84) for temporarily storing data acquired from the update memory by the copy task;
In the copy task (S416, S456), the reference task is not referring to the reference memory, the update task is not updating the update memory, and the copy task is acquired from the update memory. When the update task has not updated the update memory while storing the data to be stored in the temporary storage memory, the data of the update memory stored in the temporary storage memory is written to the reference memory.
Data processing device.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016010668A JP2017130140A (en) | 2016-01-22 | 2016-01-22 | Data processor |
DE102017200571.8A DE102017200571A1 (en) | 2016-01-22 | 2017-01-16 | DATA PROCESSING DEVICE |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016010668A JP2017130140A (en) | 2016-01-22 | 2016-01-22 | Data processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2017130140A true JP2017130140A (en) | 2017-07-27 |
Family
ID=59295720
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016010668A Pending JP2017130140A (en) | 2016-01-22 | 2016-01-22 | Data processor |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2017130140A (en) |
DE (1) | DE102017200571A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020123127A (en) * | 2019-01-30 | 2020-08-13 | 日立オートモティブシステムズ株式会社 | Electronic control device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009245009A (en) | 2008-03-28 | 2009-10-22 | Fujitsu Ten Ltd | Vehicle control device and multi-core processor |
-
2016
- 2016-01-22 JP JP2016010668A patent/JP2017130140A/en active Pending
-
2017
- 2017-01-16 DE DE102017200571.8A patent/DE102017200571A1/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2020123127A (en) * | 2019-01-30 | 2020-08-13 | 日立オートモティブシステムズ株式会社 | Electronic control device |
JP7140689B2 (en) | 2019-01-30 | 2022-09-21 | 日立Astemo株式会社 | electronic controller |
Also Published As
Publication number | Publication date |
---|---|
DE102017200571A1 (en) | 2017-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9043806B2 (en) | Information processing device and task switching method | |
WO2013186722A4 (en) | Selectively controlling instruction execution in transactional processing | |
WO2017096917A1 (en) | Method and apparatus for injecting hot patch | |
JP2011095952A (en) | Method for updating firmware and electronic equipment | |
US20120226843A1 (en) | Method and Computer System for Processing Data in a Memory | |
US9317438B2 (en) | Cache memory apparatus, cache control method, and microprocessor system | |
JP2017130140A (en) | Data processor | |
JP6468053B2 (en) | Information processing apparatus, parallel processing program, and shared memory access method | |
JP2010061620A (en) | Dma device and dma transfer method | |
JP5870043B2 (en) | Start control device, information device, and start control method | |
US10324751B2 (en) | Information processing apparatus, information processing method, and non-transitory computer-readable recording medium recording information processing program | |
US20120005687A1 (en) | System activation method in multi-task system | |
US20100146332A1 (en) | Data correction circuit and semiconductor integrated circuit | |
JP6160571B2 (en) | Data processing device | |
CN109358903B (en) | Data access device and access error notification method | |
US11681527B2 (en) | Electronic device and multiplexing method of spatial | |
JP6252259B2 (en) | Electronic control unit | |
JP2005157717A (en) | Data transfer method and device | |
JP7124023B2 (en) | controller | |
KR101779118B1 (en) | Method for managing stack of memory | |
JP6073004B1 (en) | Information processing device | |
KR101014524B1 (en) | Method of reading data coherently | |
KR20180118699A (en) | Register access control | |
JP2019179282A (en) | Control program and control system | |
JP2013190929A (en) | Microcomputer |