JP4559958B2 - Multi-core control method in multi-core processor - Google Patents
Multi-core control method in multi-core processor Download PDFInfo
- Publication number
- JP4559958B2 JP4559958B2 JP2005337271A JP2005337271A JP4559958B2 JP 4559958 B2 JP4559958 B2 JP 4559958B2 JP 2005337271 A JP2005337271 A JP 2005337271A JP 2005337271 A JP2005337271 A JP 2005337271A JP 4559958 B2 JP4559958 B2 JP 4559958B2
- Authority
- JP
- Japan
- Prior art keywords
- core
- exclusive control
- core processor
- processor
- control target
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、マルチコアプロセッサの制御方法に関し、特に各マルチコアプロセッサ間の排他制御機能を備えたマルチコアプロセッサにおけるマルチコア制御方法に関する。 The present invention relates to a control method for a multi-core processor, and more particularly to a multi-core control method in a multi-core processor having an exclusive control function between the multi-core processors.
一般的なマイクロプロセッサ、即ちシングルコアプロセッサでは、パッケージの中に命令発行器や演算器などを組み合わせた1つの部品として動作するプロセッサコアが1セット入っている。これに対しマルチコアプロセッサには、上記プロセッサコアが複数個入っており、マイクロプロセッサを複数個搭載しているような状態になる。 In a general microprocessor, that is, a single core processor, a set of processor cores that operate as one component in which an instruction issuer, an arithmetic unit, and the like are combined is included in a package. On the other hand, a multi-core processor has a plurality of processor cores and a state in which a plurality of microprocessors are mounted.
従来、シングルコアプロセッサでは、マルチタスクOSを搭載することによってマルチタスク動作を実現し、動作周波数を高くすることによって処理能力を高め、リアルタイム性能を向上してきた。 Conventionally, in a single core processor, a multitasking operation is realized by installing a multitasking OS, and a processing capability is increased by increasing an operating frequency, thereby improving real-time performance.
上記のように動作周波数を高くしてプロセッサの能力を高める方法は、熱、消費電力の面で限界に近付きつつある。
これに対し、マルチコアプロセッサの構成をとれば、動作周波数を高くすることなく処理能力を向上でき、熱、消費電力の面でシングルコアプロセッサより有利である(例えば、特許文献1参照。)。
On the other hand, the configuration of the multi-core processor can improve the processing capability without increasing the operating frequency, and is more advantageous than the single-core processor in terms of heat and power consumption (see, for example, Patent Document 1).
上記のようにシングルコアプロセッサに代えてマルチコアプロセッサを使用することにより、動作周波数を高くすることなく処理能力を向上でき、熱、消費電力の面で有利であるが、メモリの排他、入出力リソースの排他、データの同一性保持が複雑になるというデメリットがある。 By using a multi-core processor instead of a single-core processor as described above, the processing capability can be improved without increasing the operating frequency, which is advantageous in terms of heat and power consumption. There is a demerit that the exclusion of data and maintaining the identity of data become complicated.
このためマルチコアプロセッサを最適な状態でマルチタスク動作させ、信号処理システムなどのリアルタイム要求に応えるよう動作させる技術が要望されている。 For this reason, there is a demand for a technique for operating a multi-core processor in an optimal state to perform a multitask operation so as to meet a real-time request of a signal processing system or the like.
本発明は上記の課題を解決するためになされたもので、マルチコアプロセッサを用いて効率的なマルチタスク動作を行なわせることができ、時間応答性能の厳しい信号処理システムに等に適用することができるマルチコアプロセッサにおけるマルチコア制御方法を提供することを目的とする。 The present invention has been made to solve the above-described problems, and can perform an efficient multitask operation using a multicore processor, and can be applied to a signal processing system having a strict time response performance. An object of the present invention is to provide a multi-core control method in a multi-core processor.
本発明は、複数のコアプロセッサからなるマルチコアプロセッサにおいて、前記複数のコアプロセッサに内部バスにより複数のメモリを空間的に多重接続して任意のメモリをアクセスできるように構成し、前記メモリに前記複数のコアプロセッサが排他制御対象を制御することに使用されていることの使用状態を示すセマフォ管理テーブルを設け、各コアプロセッサ内における排他制御と、複数のコアプロセッサ間における排他制御と、全コアプロセッサ間における排他制御のそれぞれにセマフォIDを付与し、前記各コアプロセッサは前記セマフォIDにより識別した排他制御に切替えて前記セマフォ管理テーブルを監視し、排他制御対象へのアクセス割込みを排他することを特徴とする。 The present invention provides a multi-core processor composed of a plurality of core processors, wherein a plurality of memories are spatially multiplexed by an internal bus to the plurality of core processors so that an arbitrary memory can be accessed. core processor is provided a semaphore management table showing the use state of what is used to control the exclusive control object, and exclusive control in each core processor, and exclusive control among a plurality of core processors, all core processor A semaphore ID is assigned to each exclusive control, and each core processor switches to the exclusive control identified by the semaphore ID, monitors the semaphore management table, and excludes an access interrupt to the exclusive control target. And
本発明によれば、各コアプロセッサ内、各コアプロセッサ間、全コアプロセッサ間の排他制御にそれぞれセマフォIDを付与し、このセマフォIDにより識別した排他制御に切替えて排他制御対象へのアクセス割込みを排他することにより、マルチタスク処理を効率的に行なわせることができ、時間応答性能の厳しい信号処理システムに等に適用することが可能になる。 According to the present invention, a semaphore ID is assigned to exclusive control within each core processor, between each core processor, and between all core processors, and the exclusive control identified by this semaphore ID is switched to interrupt access to the exclusive control target. By exclusion, multitask processing can be performed efficiently, and it can be applied to a signal processing system with strict time response performance.
以下、図面を参照して本発明の一実施形態を説明する。
図1は、本発明の一実施形態に係るマルチコアプロセッサの構成を示すブロック図である。図1において、11は第1のコアプロセッサ(コア0)、12は第2のコアプロセッサ(コア1)、13は第3のコアプロセッサ(コア2)で、L1メモリ21〜23がそれぞれ付属している。このL1メモリ21〜23の一部には、キャッシュメモリが配置される。また、上記コアプロセッサ11〜13は、シングルスタックのOSで動作するもので、その優先度は例えば「コア0<コア1<コア2」に設定される。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a multi-core processor according to an embodiment of the present invention. In FIG. 1, 11 is a first core processor (core 0), 12 is a second core processor (core 1), 13 is a third core processor (core 2), and
そして、上記コアプロセッサ11〜13は、内部バス14及び外部バス15に接続される。
上記内部バス14には、複数個例えば4個のL2メモリ(0)31、L2メモリ(1)32、L2メモリ(2)33、L2メモリ(3)34が接続される。また、上記L2メモリ31〜34には、セマフォ管理テーブルが設けられる。この場合、セマフォ管理テーブルは、L2メモリ31〜34の何れに配置しても良い。
The
A plurality of, for example, four L2 memories (0) 31, an L2 memory (1) 32, an L2 memory (2) 33, and an L2 memory (3) 34 are connected to the internal bus. The L2 memories 31 to 34 are provided with semaphore management tables. In this case, the semaphore management table may be arranged in any of the L2 memories 31 to 34.
上記コアプロセッサ11〜13とL2メモリ31〜34は、内部バス14を空間的に多重接続しており、例えばコアプロセッサ11がL2メモリ31にアクセス中に、コアプロセッサ12がL2メモリ32に、コアプロセッサ(コア2)13がL2メモリ(3)34に同時にアクセス可能に接続されている。例えばL2メモリ31〜34のそれぞれにデータバスを32本ずつ接続し、アドレスバスの上位ビットをチップセレクト信号に割り当ててアクセス対象を選択するように構成する。従って、コアプロセッサ11〜13は、L2メモリ31〜34の何れにもアクセス可能となっている。
The
また、上記外部バス15には、ホスト(HOST)プロセッサ41,SDRAM(Synchronous DRAM)42及び通信デバイス43が接続される。
図2は、上記実施形態におけるマルチタスク構成例を示したものである。上記各コアプロセッサ11〜13は、それぞれ1つのタスク(Task 0、Task 1、Task 2)と、複数のソフトウェア割込(SWI 0、SWI 1)と、複数のハードウェア割込(HWI)を備えると共に共通部50としてライブラリ(Library)51、IPL(Initial Program Loader)52、OS(Operating System)53、ドライバ(Driver)54を備えている。一般に1つのコアプロセッサでマルチタスクを実行する場合、タスクを切替える際にタスクコンテキスト(レジスタやスタック)を切替える必要がある。この実施形態では、上記したように各コアプロセッサ11〜13にそれぞれ1つのタスク(Task 0、Task 1、Task 2)を割り当てることにより、同一のコアプロセッサ内ではタスクコンテキストの切替えを不要にしている。
The
FIG. 2 shows an example of a multitask configuration in the embodiment. Each of the
上記共通部50は、L2メモリ31〜34に格納され、L1メモリ21〜23の一部に配置するキャッシュメモリを介在してコアプロセッサ11〜13からアクセスされる。共通部50をL2メモリ31〜34に配置することにより、容量の少ないL1メモリ21〜23を補っている。
The
上記コアプロセッサ11〜13は、コア内、コア間、全コア間の排他制御にセマフォIDを付与し、このセマフォIDを識別して排他制御処理を切替えている。
The
以下、上記コアプロセッサ11〜13におけるコア内、コア間、全コア間の排他制御処理について説明する。
[コア内排他制御処理]
例えば関数の引数で各コアプロセッサ11〜13内のセマフォを指定するIDが付与されている場合は、図3に示すように排他制御対象61へのアクセスを割込み禁止処理と割込み禁止解除処理で挟むことにより、排他制御対象61へのアクセスを排他する。図3はコアプロセッサ11内における排他制御処理を示したもので、ソフトウェア割込SWI 0がソフトウェア割込SWI 1の起動の禁止/解除を管理している。
Hereinafter, exclusive control processing within the core, between the cores, and between all the cores in the
[In-core exclusive control processing]
For example, when an ID specifying a semaphore in each of the
図3において、例えばタスクTask 0が排他制御対象61をアクセスする場合、タスクTask 0は、先ずソフトウェア割込SWI 0に対して割込み禁止を指示し(ステップA1)、その応答を待って排他制御対象61にアクセスする(ステップA2)。このアクセス中にハードウェア割込みHWIからソフトウェア割込みSWI 0にSWI 1割込み要求が発生すると、この時点ではソフトウェア割込みSWI 0が割込み禁止状態にあるので、ハードウェア割込みHWIによる割込み要求は受け付けられない。
In FIG. 3, for example, when the
その後、タスクTask 0が排他制御対象61に対するアクセスを終了すると、タスクTask 0からソフトウェア割込SWI 0に割込み禁止解除通知が送られ(ステップA3)、ソフトウェア割込SWI 0の割込み禁止が解除される。これによりソフトウェア割込SWI 0は、上記ハードウェア割込みHWIからのSWI 1割込み要求を受付け、ソフトウェア割込SWI 1に起動指令を出力する(ステップA4)。
Thereafter, when the
ソフトウェア割込SWI 1は、上記起動指令によって起動し、排他制御対象61に割込み禁止を指示し(ステップA5)、その応答を待って排他制御対象61をアクセスする(ステップA6)。そして、ソフトウェア割込SWI 1は、排他制御対象61に対するアクセスを終了すると、排他制御対象61に割込み禁止解除を通知し(ステップA7)、その応答を待って排他制御対象61に処理終了を通知する(ステップA8)。排他制御対象61は、ソフトウェア割込SWI 1によるアクセスが終了したことをタスクTask 0に通知する(ステップA9)。
上記のように各コアプロセッサ11〜13内において、排他制御対象61に対するアクセスの排他制御処理が行なわれる。
The software interrupt
As described above, the exclusive control processing for access to the
[コア間排他制御処理]
また、コアプロセッサ11〜13において、2つのコア間のセマフォを指定するIDが指定されたときは、図4に示すようにL2メモリ31〜34に配置するセマフォ管理テーブル62を各コアプロセッサ11〜13で監視することによって排他制御を実現する。図4は、コアプロセッサ11、12間における排他制御対象61に対する排他制御を行なう場合について示したもので、セマフォ管理テーブル62にはコア0状態エリア62a、コア1状態エリア62bが設けられている。
[Inter-core exclusive control processing]
In addition, when an ID for designating a semaphore between two cores is designated in the
セマフォ管理テーブル62のコア0状態エリア62aには、コアプロセッサ(コア0)11が「使用中」であるか「空き」となっているかを書込み、コア1状態エリア62bにはコアプロセッサ(コア1)12が「使用中」であるか「空き」となっているかを書込んで管理する。
In the
[コアプロセッサ11の動作手順]
先ず、コアプロセッサ11の動作手順について図5のフローチャートを参照して説明する。
コアプロセッサ11は、セマフォ管理テーブル62のコア1状態エリア62bからコアプロセッサ12の使用状態を読出し(ステップB1)、「空き」であるか使用中であるかを判断する(ステップB2)。コアプロセッサ12が空いている場合は、コア0状態エリア62aに「使用中」を書込み(ステップB3)、排他制御対象61をアクセスする(ステップB4)。ステップB5では、上記排他制御対象61に対する処理が終了したかどうかを判断し、排他制御対象61へのアクセスが終了すると、コア0状態エリア62aに「空き」を書込み(ステップB6)、処理を終了する。
[Operation procedure of core processor 11]
First, the operation procedure of the
The
また、上記ステップB2で、コアプロセッサ12が使用中であると判断された場合は、コアプロセッサ12、即ち「コア1状態」が「空き」なるまでスピンロック(spin lock)で待つ(ステップB7)。そして、コアプロセッサ12が「空き」になると、排他制御対象61をアクセスする(ステップB8)。ステップB9では、上記排他制御対象61に対する処理が終了したかどうかを判断し、排他制御対象61へのアクセスが終了すると、コア0状態エリア62aに「空き」を書込み(ステップB10)、処理を終了する。
If it is determined in step B2 that the
[コアプロセッサ12の動作手順]
次に、コアプロセッサ12の動作手順について図6のフローチャートを参照して説明する。
コアプロセッサ12は、セマフォ管理テーブル62のコア0状態エリア62aからコアプロセッサ11の使用状態、即ち「コア0状態」を読出し(ステップC1)、「空き」であるか使用中であるかを判断する(ステップC2)。コアプロセッサ11が空いている場合は、コア1状態エリア62bに「使用中」を書込み(ステップC3)、排他制御対象61をアクセスする(ステップC4)。ステップC5では、上記排他制御対象61に対する処理が終了したかどうかを判断し、排他制御対象61へのアクセスが終了すると、コア1状態エリア62bに「空き」を書込み(ステップC6)、処理を終了する。
[Operation procedure of core processor 12]
Next, the operation procedure of the
The
また、上記ステップC2で、コアプロセッサ11が使用中であると判断された場合は、コアプロセッサ11、即ち「コア0状態」が「空き」なるまでスピンロック(spin lock)で待つ(ステップC7)。そして、コアプロセッサ11が「空き」になると、排他制御対象61をアクセスする(ステップC8)。ステップC9では、上記排他制御対象61に対する処理が終了したかどうかを判断し、排他制御対象61へのアクセスが終了すると、コア1状態エリア62bに「空き」を書込み(ステップC10)、処理を終了する。
If it is determined in step C2 that the
[全コア間排他制御処理]
次に全コア間の排他制御処理について説明する。
コアプロセッサ11〜13において、全コア間のセマフォを指定するIDが指定されたときは、L2メモリ31〜34に配置する図7に示すセマフォ管理テーブル63を各コアプロセッサ11〜13で監視することによって排他制御を実現する。ここで、上記したように各コアプロセッサ11〜13に
コア0<コア1<コア2
の優先度を与えることによって、優先度の高いコアの処理を優先的に短いオーバヘッドで行なう。
[Exclusive control between all cores]
Next, exclusive control processing between all cores will be described.
When the
By giving this priority, the processing of the core with the higher priority is preferentially performed with a short overhead.
上記セマフォ管理テーブル63は、図7に示すように排他制御対象状態エリア63a、コア0状態エリア63b、コア1状態エリア63c、コア2状態エリア63dを備えている。上記排他制御対象状態エリア63aには、「コア0/コア1/コア2/空き」の状態が選択的に書込まれる。コア0状態エリア63bには、コア0(コアプロセッサ11)に関する「使用中/空き/待ち」の状態が選択的に書込まれる。コア1状態エリア63cには、コア1(コアプロセッサ12)に関する「使用中/空き/待ち」の状態が選択的に書込まれる。コア2状態エリア63dには、コア2(コアプロセッサ13)に関する「使用中/空き/待ち」の状態が選択的に書込まれる。
As shown in FIG. 7, the semaphore management table 63 includes an exclusive control target state area 63a, a
[コアプロセッサ11(優先度“低”)の動作手順]
先ず、コアプロセッサ(コア0)11の動作手順について図8のフローチャートを参照して説明する。
コアプロセッサ11は、セマフォ管理テーブル63のコア0状態エリア63bに「待ち」を書込み(ステップD1)、次いでコア1状態エリア63c及びコア2状態エリア63dからコア1とコア2の状態を読み込んで、両方が「空き」となっているかどうかを判断する(ステップD2、D3)。上記コア1とコア2の状態が両方とも「空き」であれば、排他制御対象状態エリア63aにおける排他制御対象状態が「空き」になるまで、スピンロックで待つ(ステップD4)。
[Operation Procedure of Core Processor 11 (Priority “Low”)]
First, the operation procedure of the core processor (core 0) 11 will be described with reference to the flowchart of FIG.
The
そして、上記排他制御対象状態が「空き」になると、排他制御対象状態エリア63aに「コア0」を書込み(ステップD5)、コア0状態エリア63bに「使用中」を書込む(ステップD6)。その後、コアプロセッサ11は、排他制御対象を使用する(ステップD7)。次に上記排他制御対象の使用が終了したかどうかを判断し(ステップD8)、排他制御対象の使用が終了すると、コア0状態エリア63bに「空き」を書込むと共に排他制御対象状態エリア63aに「空き」を書込み(ステップD9、D10)、コアプロセッサ11の処理を終了する。
When the exclusive control target state becomes “vacant”, “
また、上記ステップD3で、コア1とコア2の何れか一方でも「空き」以外の状態になっていると判断された場合は、排他制御対象状態エリア63aにおける排他制御対象状態が「空き」になるまで、スピンロックで待つ(ステップD11)。そして、上記排他制御対象状態が「空き」になるとステップD2に戻り、上記した処理を繰り返して実行する。
If it is determined in step D3 that either one of the
[コアプロセッサ12(優先度“中”)の動作手順]
次にコアプロセッサ(コア1)12の動作手順について図9のフローチャートを参照して説明する。
コアプロセッサ12は、セマフォ管理テーブル63のコア1状態エリア63cに「待ち」を書込み(ステップE1)、次いでコア2状態エリア63dからコア2の状態を読み込んで、「空き」となっているかどうかを判断する(ステップE2、E3)。上記コア2の状態が「空き」であれば、排他制御対象状態エリア63aにおける排他制御対象状態が「空き」になるまで、スピンロックで待つ(ステップE4)。
[Operation Procedure of Core Processor 12 (Priority “Medium”)]
Next, the operation procedure of the core processor (core 1) 12 will be described with reference to the flowchart of FIG.
The
そして、上記排他制御対象状態が「空き」になると、コアプロセッサ12は、排他制御対象状態エリア63aに「コア1」、コア1状態エリア63cに「使用中」を書込み(ステップE5、E6)、排他制御対象を使用する(ステップE7)。
When the exclusive control target state becomes “vacant”, the
次に上記排他制御対象の使用が終了したかどうかを判断し(ステップE8)、排他制御対象の使用が終了すると、コア1状態エリア63cに「空き」を書込むと共に排他制御対象状態エリア63aに「空き」を書込み(ステップE9、E10)、コアプロセッサ12の処理を終了する。
Next, it is determined whether or not the use of the exclusive control target is finished (step E8). When the use of the exclusive control target is finished, “empty” is written in the
また、上記ステップE3で、コア2が「空き」以外の状態になっていると判断された場合は、排他制御対象状態エリア63aにおける排他制御対象状態が「空き」になるまで、スピンロックで待つ(ステップE11)。そして、上記排他制御対象状態が「空き」になるとステップE2に戻り、上記した処理を繰り返して実行する。
If it is determined in step E3 that the
[コアプロセッサ13(優先度“高”)の動作手順]
次にコアプロセッサ(コア2)13の動作手順について図10のフローチャートを参照して説明する。
コアプロセッサ13は、セマフォ管理テーブル63のコア2状態エリア63dに「待ち」を書込み(ステップF1)、その後、排他制御対象状態エリア63aにおける排他制御対象状態が「空き」になるまで、スピンロックで待つ(ステップF2)。
[Operation Procedure of Core Processor 13 (Priority “High”)]
Next, the operation procedure of the core processor (core 2) 13 will be described with reference to the flowchart of FIG.
The
そして、上記排他制御対象状態が「空き」になると、コアプロセッサ13は、排他制御対象状態エリア63aに「コア1」、コア2状態エリア63dに「使用中」を書込み(ステップF3、F4)、その後、排他制御対象を使用する(ステップF5)。
When the exclusive control target state becomes “free”, the
次に上記排他制御対象の使用が終了したかどうかを判断し(ステップF6)、排他制御対象の使用が終了すると、コア2状態エリア63dに「空き」を書込むと共に排他制御対象状態エリア63aに「空き」を書込み(ステップF7、F8)、コアプロセッサ13の処理を終了する。
Next, it is determined whether or not the use of the exclusive control target is finished (step F6). When the use of the exclusive control target is finished, “empty” is written in the
上記のように各コアプロセッサ11〜13に「コア0<コア1<コア2」の優先度を与えると共に、図7に示すセマフォ管理テーブル63を各コアプロセッサ11〜13で監視することによって全コア間の排他制御を実現でき、また、優先度の高いコアの処理を優先的に短いオーバヘッドで行なうことができる。
As described above, the priority of “
また、上記実施形態において、図11に示すようなリングバッファ型の共有メモリ64をL2メモリ31〜34又は外部バス15に接続されるSDRAM42に配置することにより、コアプロセッサ11〜13間のデータ通信を行なうことも可能である。この場合、各コアプロセッサ11〜13からL2メモリ31〜34又はSDRAM42へのアクセスは、ソフトウェア処理の負荷を軽減するためにアトミックなハードウェアによって保証する。すなわち、コアプロセッサ11〜13からL2メモリ31〜34又はSDRAM42へのアクセスは、ある時間に何れか1つだけアクセスすることを可能にしている。
In the above embodiment, the ring buffer type shared
図11は、コアプロセッサ11とコアプロセッサ12間でデータの書込み及び読出しを行なう場合の例を示したもので、共有メモリ64は、例えばコア0ライトポインタ64a、コア1リードポインタ64b、及びリングバッファを構成する0〜Nの固定長データエリア65a〜65nを備えている。
FIG. 11 shows an example in which data is written and read between the
次に、書込み側のコアプロセッサ(コア0)11及び読出し側のコアプロセッサ(コア1)12の動作手順について図12及び図13のフローチャートを参照して説明する。 Next, operation procedures of the write-side core processor (core 0) 11 and the read-side core processor (core 1) 12 will be described with reference to the flowcharts of FIGS.
[書込み側のコアプロセッサ(コア0)11の動作手順]
図12のフローチャートに示すように、コアプロセッサ11は、コア0ライトポインタ64a及びコア1リードポインタ64bを読出し(ステップG1)、コア0ライトポインタ64aが1周回ってコア1リードポインタ64bに追いついたかどうかを判断する(ステップG2)。コア0ライトポインタ64aがコア1リードポインタ64bに追いついていなければ、コア0ライトポインタ64aが指す固定長データの次のエリアにデータを書込み(ステップG3)、コア0ライトポインタ64aを次のエリアを指すように更新し(ステップG4)、データの書込み処理を終了する。
[Operation Procedure of Core Processor (Core 0) 11 on Writing Side]
As shown in the flowchart of FIG. 12, the
また、上記ステップG2で、コア0ライトポインタ64aがコア1リードポインタ64bに追いついたと判断された場合は、書込みデータを破棄し(ステップG5)、エラー終了する。
If it is determined in step G2 that the
[読出し側のコアプロセッサ(コア1)12の動作手順]
図13のフローチャートに示すように、コアプロセッサ12は、コア0ライトポインタ64a及びコア1リードポインタ64bを読出し(ステップH1)、コア1リードポインタ64bが1周回ってコア0ライトポインタ64aに追いついたかどうかを判断する(ステップH2)。コア1リードポインタ64bがコア0ライトポインタ64aに追いついていなければ、コア1リードポインタ64bが指す固定長データエリアを読出し(ステップH3)、コア1リードポインタ64bを次のエリアを採用に更新する(ステップH4)、その後、ステップH1に戻り、上記した処理を繰り返して実行する。
[Operation Procedure of Core Processor (Core 1) 12 on Reading Side]
As shown in the flowchart of FIG. 13, the
そして、上記ステップH2で、コア1リードポインタ64bがコア0ライトポインタ64aに追いついたと判断された場合は、ステップH5に進んで読出しデータなしで終了する。
If it is determined in step H2 that the
上記実施形態によれば、マルチコアプロセッサでマルチタスクを実行する場合、1つのコアプロセッサには1つのタスクだけを割り当てることにより、タスクコンテキスト(レジスタやスタック)を切替えることなくマルチタスク処理を実行することができる。 According to the above embodiment, when multitasking is executed by a multicore processor, only one task is assigned to one core processor, thereby executing multitask processing without switching task context (registers and stacks). Can do.
また、コアプロセッサ11〜13とL2メモリ31〜34は、内部バス14を空間的に多重接続して各L2メモリ31〜34に同時にアクセスできるように構成し、上記L2メモリ31〜34にセマフォ管理テーブルを配置することにより、スピンロック時にバスアクセスが増大する事によるビジーロックを緩和することができる。
The
また、各コアプロセッサ11〜13内、各コアプロセッサ11〜13間、及び全コアプロセッサ11〜13間の排他制御にそれぞれセマフォIDを付与し、このセマフォIDにより識別した排他制御処理を切替え、排他制御対象へのアクセス割込みを排他することにより、マルチタスク処理を効率的に行なわせることができる。 In addition, each semaphore ID is assigned to the exclusive control within each core processor 11-13, between each core processor 11-13, and between all core processors 11-13, and the exclusive control process identified by this semaphore ID is switched and exclusive. By excluding access interrupts to controlled objects, multitask processing can be performed efficiently.
また、上記全コアプロセッサ11〜13間の排他制御において、各コアプロセッサ11〜13に優先度を与える事によって、高い優先度の処理を優先的に短いオーバヘッドで行なわせることができる。
In the exclusive control among all the
また、リングバッファ型の共有メモリ64をアトミックな領域、例えばL2メモリ31〜34又は外部バス15に接続されるSDRAM42に配置することにより、コアプロセッサ11〜13間のデータ通信を行なうことが可能となる。この場合、共有メモリ64をアトミックな領域に配置することにより、ソフトウェア処理の負荷を軽減することができる。
In addition, by arranging the ring buffer type shared
なお、本発明は、上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できるものである。 Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying constituent elements without departing from the scope of the invention in the implementation stage.
11〜13…コアプロセッサ、14…内部バス、15…外部バス、21〜23…L1メモリ、31〜34…L2メモリ、41…ホストプロセッサ、42…SDRAM、43…通信デバイス、50…共通部、51…ライブラリ(Library)、52…IPL、53…OS、54…ドライバ(Driver)、61…排他制御対象、62…セマフォ管理テーブル、62a…コア0状態エリア、62b…コア1状態エリア、63…セマフォ管理テーブル、63a…排他制御対象状態エリア、63b…コア0状態エリア、63c…コア1状態エリア、63d…コア2状態エリア、64…共有メモリ、64a…ライトポインタ、64b…リードポインタ、65a〜65n…固定長データエリア。
DESCRIPTION OF SYMBOLS 11-13 ... Core processor, 14 ... Internal bus, 15 ... External bus, 21-23 ... L1 memory, 31-34 ... L2 memory, 41 ... Host processor, 42 ... SDRAM, 43 ... Communication device, 50 ... Common part, 51 ... Library, 52 ... IPL, 53 ... OS, 54 ... Driver, 61 ... Exclusive control target, 62 ... Semaphore management table, 62a ...
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005337271A JP4559958B2 (en) | 2005-11-22 | 2005-11-22 | Multi-core control method in multi-core processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005337271A JP4559958B2 (en) | 2005-11-22 | 2005-11-22 | Multi-core control method in multi-core processor |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2007141155A JP2007141155A (en) | 2007-06-07 |
JP4559958B2 true JP4559958B2 (en) | 2010-10-13 |
Family
ID=38203904
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005337271A Expired - Fee Related JP4559958B2 (en) | 2005-11-22 | 2005-11-22 | Multi-core control method in multi-core processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4559958B2 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5146954B2 (en) * | 2007-09-12 | 2013-02-20 | 独立行政法人産業技術総合研究所 | Multitask processing apparatus, multitask processing method, and program |
JP2010039582A (en) * | 2008-07-31 | 2010-02-18 | Panasonic Corp | Resource exclusive control system, device, method and program |
WO2011121730A1 (en) * | 2010-03-30 | 2011-10-06 | 富士通株式会社 | Multi-core processor sytem, control program, and control method |
JP5745868B2 (en) * | 2011-01-18 | 2015-07-08 | トヨタ自動車株式会社 | Multiprocessor system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06348661A (en) * | 1993-06-11 | 1994-12-22 | Fujitsu Ltd | Exclusive control method between multiple processors |
JP2004506981A (en) * | 2000-08-15 | 2004-03-04 | エス・アール・シィ・コンピューターズ・インコーポレイテッド | System and method for managing semaphore and atomic operations in a multiprocessor |
-
2005
- 2005-11-22 JP JP2005337271A patent/JP4559958B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06348661A (en) * | 1993-06-11 | 1994-12-22 | Fujitsu Ltd | Exclusive control method between multiple processors |
JP2004506981A (en) * | 2000-08-15 | 2004-03-04 | エス・アール・シィ・コンピューターズ・インコーポレイテッド | System and method for managing semaphore and atomic operations in a multiprocessor |
Also Published As
Publication number | Publication date |
---|---|
JP2007141155A (en) | 2007-06-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6820187B2 (en) | Multiprocessor system and control method thereof | |
TWI537831B (en) | Multi-core processor,method to perform process switching,method to secure a memory block, apparatus to enable transactional processing using a multi core device and method to perform memory transactional processing | |
JP5909566B2 (en) | Computer system and control method thereof | |
US20110265093A1 (en) | Computer System and Program Product | |
JP4026667B2 (en) | Multi-OS configuration method | |
JP4559958B2 (en) | Multi-core control method in multi-core processor | |
JP2006209448A (en) | Direct memory access control method, direct memory access control device, information processing system, program | |
WO2009098737A1 (en) | External device access apparatus, its controlling method and system lsi | |
JP2002297556A (en) | Multiprocessor system, control method and program for multiprocessor, and computer readable recording medium with the program recorded thereon | |
JP4734348B2 (en) | Asynchronous remote procedure call method, asynchronous remote procedure call program and recording medium in shared memory multiprocessor | |
JP3893136B2 (en) | Embedded computer control program, recording medium recording the program, and embedded system | |
US11734051B1 (en) | RTOS/OS architecture for context switching that solves the diminishing bandwidth problem and the RTOS response time problem using unsorted ready lists | |
JP2005258509A (en) | Storage device | |
JP4727480B2 (en) | Information processing method, information processing system, information processing apparatus, multiprocessor, information processing program, and computer-readable storage medium storing information processing program | |
WO2007049543A1 (en) | Calculating apparatus | |
JP2010044703A (en) | Method and program for switching task in multi task os | |
JPH1021203A (en) | I / O device access method and multiprocessor system therefor | |
JP2010026575A (en) | Scheduling method, scheduling device, and multiprocessor system | |
JPS62177653A (en) | Control system for shared memory | |
JPH01137359A (en) | Processor control system | |
JP4631442B2 (en) | Processor | |
JP2003030051A (en) | Data processor and data access method | |
JP2007328539A (en) | Bus system, bus slave and bus control method | |
WO2019188180A1 (en) | Scheduling method and scheduling device | |
JP2007087244A (en) | Co-processor and computer system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080922 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100226 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100413 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100609 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100706 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100723 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4559958 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130730 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140730 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |