JP2014153860A - Multi-thread processor - Google Patents
Multi-thread processor Download PDFInfo
- Publication number
- JP2014153860A JP2014153860A JP2013022209A JP2013022209A JP2014153860A JP 2014153860 A JP2014153860 A JP 2014153860A JP 2013022209 A JP2013022209 A JP 2013022209A JP 2013022209 A JP2013022209 A JP 2013022209A JP 2014153860 A JP2014153860 A JP 2014153860A
- Authority
- JP
- Japan
- Prior art keywords
- thread
- authority
- schedule
- execution
- cycle number
- 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
Landscapes
- Storage Device Security (AREA)
Abstract
Description
本発明は、マルチスレッドプロセッサに関し、特に各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作するマルチスレッドプロセッサに関する。 The present invention relates to a multi-thread processor, and more particularly to a multi-thread processor in which each thread operates with user authority or authority other than user authority every cycle.
制御システムのような高い信頼性・リアルタイム性が求められるコンピュータシステムでは、要求される機能ごとに機器が用意され、これら複数の機器が連携動作することにより1つのシステムを構成している。近年では、複数の機能を1つのプロセッサにて統合実行する技術が知られている。 In a computer system such as a control system that requires high reliability and real-time performance, a device is prepared for each required function, and a plurality of these devices operate together to constitute one system. In recent years, a technique is known in which a plurality of functions are integrated and executed by a single processor.
たとえば、特許文献1(特開2011−128767号公報)のマルチスレッド処理装置は、複数のスレッドに対して、スレッドの作動割合である帯域を設定する帯域設定手段と、各スレッドの処理負荷を監視し、各スレッドの処理負荷が平準化するような帯域変更を帯域設定手段に指示する帯域制御手段とを備える。 For example, a multi-thread processing device disclosed in Patent Document 1 (Japanese Patent Laid-Open No. 2011-128767) monitors a processing load of each thread and a bandwidth setting unit that sets a bandwidth that is an operation ratio of the thread for a plurality of threads And a bandwidth control means for instructing the bandwidth setting means to change the bandwidth so that the processing load of each thread is leveled.
特許文献2(特開2010−286898号公報)のマルチスレッド実行装置は、プログラム毎に、命令の目標実行速度情報を記憶するとともに、命令の実行完了速度を監視する。フィードバック制御手段が、実行完了速度が目標実行速度情報に略一致するように、命令発行手段に命令を発行させる。 The multi-thread execution device of Patent Document 2 (Japanese Patent Laid-Open No. 2010-286898) stores target instruction execution speed information for each program and monitors the instruction execution completion speed. The feedback control means causes the instruction issuing means to issue an instruction so that the execution completion speed substantially matches the target execution speed information.
マルチスレッド環境で動作する各プログラムは、対応のスレッドに割り当てられる。各スレッドには、対応のプログラムの優先度などを考慮して、実行サイクルが割り当てられる。 Each program operating in a multi-thread environment is assigned to a corresponding thread. Each thread is assigned an execution cycle in consideration of the priority of the corresponding program.
しかしながら、スレッドにて動作するプログラムからスーパーバイザやハイパーバイザを呼び出すことによって、スーパーバイザやハイパーバイザがスレッドに割当てられた実行サイクルを消費する。その結果、ユーザ権限以外のスーパーバイザ権限やハイパーバイザ権限で動作したサイクル数だけプログラムが動作するサイクル数が減らされる。そのため、プログラムの実行速度が低下するという問題がある。 However, by calling a supervisor or hypervisor from a program operating in a thread, the supervisor or hypervisor consumes an execution cycle assigned to the thread. As a result, the number of cycles in which the program operates is reduced by the number of cycles operated with supervisor authority or hypervisor authority other than user authority. Therefore, there is a problem that the execution speed of the program decreases.
それゆえに、本発明の目的は、ユーザ権限以外の権限でスレッドが動作した場合において、プログラムの実行速度が低下することを防止することができるマルチスレッドプロセッサを提供することである。 Therefore, an object of the present invention is to provide a multi-thread processor that can prevent a decrease in the execution speed of a program when a thread operates with an authority other than a user authority.
上記課題を解決するために、本発明のマルチスレッドプロセッサは、各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作するマルチスレッドプロセッサであって、サイクル単位で実行するスレッドを切り換えるスケジューラと、オペレーティングシステムまたはハイパーバイザによって実行するスレッドが設定される第1期間以外の第2期間に実行するスレッドを設定するスケジュール調整部とを備える。スケジュール調整部は、ユーザ権限以外の権限で動作したスレッドが、第2期間において、補充的に実行されるように調整する。 In order to solve the above problems, a multi-thread processor of the present invention is a multi-thread processor in which each thread operates with user authority or authority other than user authority every cycle, and a scheduler that switches threads to be executed in units of cycles. A schedule adjusting unit that sets a thread to be executed in a second period other than the first period in which a thread to be executed by the operating system or the hypervisor is set. The schedule adjustment unit adjusts the thread that has been operated with an authority other than the user authority to be supplementarily executed in the second period.
本発明のマルチスレッドプロセッサによれば、ユーザ権限以外の権限でスレッドが動作した場合において、プログラムの実行速度が低下することを防止することができる。 According to the multi-thread processor of the present invention, it is possible to prevent the execution speed of a program from being lowered when a thread operates with an authority other than the user authority.
以下、本発明の実施の形態について、図面を用いて説明する。
[第1の実施形態]
図1は、第1の実施形態のマルチスレッドプロセッサの概略構成の一例である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is an example of a schematic configuration of the multithread processor according to the first embodiment.
図1に示すように、このマルチスレッドプロセッサは、命令バス100と、主記憶部101と、第0命令バッファ110と、第1命令バッファ111と、命令フェッチ部145と、セレクタ120と、デコーダ130と、実行部140と、スレッドスケジューラ160と、スケジュールレジスタ180と、スケジュール調整部192と、実行サイクル数加算部190と、実行サイクル数テーブル記憶部191と、データバス170と、主記憶部102と、第0レジスタセット150と、第1レジスタセット151と、セレクタ121と、セレクタ122とを備える。
As shown in FIG. 1, the multi-thread processor includes an
本実施の形態のマルチスレッドプロセッサは、スレッド0およびスレッド1からなるマルチスレッドの実行環境を有する。このマルチスレッドプロセッサは、各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作する。
The multi-thread processor according to the present embodiment has a multi-thread execution
マルチスレッド実行環境では、複数のスレッドが、ハードウエアの一部を共有して処理を行なうものである。ここで、スレッドとは、ハードウエアを部分的に共有して処理を行なう仮想的な処理主体をいう。本実施の形態では、第0命令バッファ110および第0レジスタセット150は、スレッド0で用いられ、第1命令バッファ111および第1レジスタセット151は、スレッド1で用いられる。プロセッサにおけるその他の構成要素はスレッド0およびスレッド1の間で共用される。
In a multi-thread execution environment, a plurality of threads share a part of hardware for processing. Here, a thread refers to a virtual processing entity that performs processing while partially sharing hardware. In the present embodiment, the
プロセッサが基本的な動作を行なう最小単位である1サイクル毎に、スレッド0またはスレッド1が実行スレッドとして順に選択される。以下、実行スレッドとは、処理を実行中のスレッドをいうものとする。実行スレッドの切り替えは、スレッドスケジューラ160によって制御される。
For each cycle, which is the minimum unit in which the processor performs basic operations,
命令バス100は、接続された回路間で命令データが伝送されるバスである。データバス170は、接続された回路間でデータが伝送されるバスである。
The
主記憶部101は、命令バス100と接続されている。主記憶部101は、プログラムA、プログラムB、プログラムAで利用されるOS_A、プログラムBで利用されるOS_B、およびOS_AとOS_B間の保護や調停を行なうソフトウエアであるハイパーバイザを保持している。主記憶部101は、例えば、FD(Floppy Disk)、HDD(Hard Disk Drive)、ROM(Read Only Memory)、RAM(Random Access Memory)、CD(Compact Disk)、DVD(Digital Versatile Disk)などである。
The
スレッド0は、ユーザプログラムA、OS_A、またはハイパーバイザを実行する。
スレッド1は、ユーザプログラムB、OS_B、またはハイバーバイザを実行する。
The
The
スレッド0がユーザプログラムAを実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「ユーザ権限」が設定され、スレッド0が「ユーザ権限」で動作する。スレッド0がOS_Aの機能(サービス)を実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「スーパーバイザ権限」が設定され、スレッド0が「スーパーバイザ権限」で動作する。スレッド0がハイパーバイザを実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「ハイパーバイザ権限」が設定され、スレッド0が「ハイパーバイザ権限」で動作する。
When the
また、同様に、スレッド1がユーザプログラムBを実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「ユーザ権限」が設定され、スレッド1が「ユーザ権限」で動作する。スレッド1がOS_Bの機能(サービス)を実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「スーパーバイザ権限」が設定され、スレッド1が「スーパーバイザ権限」で動作する。スレッド1がハイパーバイザを実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「ハイパーバイザ権限」が設定され、スレッド1が「ハイパーバイザ権限」で動作する。
Similarly, when the
主記憶部102は、データバス170と接続されている。主記憶部102は、プログラムAおよびプログラムBが利用するデータを保持している。主記憶部102は、例えば、FD、HDD、RAMなどである。なお、主記憶部101と主記憶部102は同一の主記憶部であってもよい。また、プログラムA用およびプログラムB用にそれぞれ個別に主記憶部101、主記憶部102があってもよい。
The
第0命令バッファ110および第1命令バッファ111は、それぞれ命令バス100と接続されている。命令バス100は、主記憶部101と接続されている。
The
命令フェッチ部145は、第0命令バッファ110用のプログラムカウンタと、第1命令バッファ111用のプログラムカウンタを有する。実行部140は、第0命令バッファ110のプログラムカウンタのアドレスを命令バス100に出力して、主記憶部101から第0命令バッファ110にプログラムAの命令を1つずつ読み出す。命令フェッチ部145は、第1命令バッファ111のプログラムカウンタのアドレスを命令バス100に出力して、主記憶部101から第1命令バッファ111にプログラムBの命令を1つずつ読み出す。
The instruction fetch
第0命令バッファ110および第1命令バッファ111は、セレクタ120に接続されている。セレクタ120は、第0命令バッファ110および第1命令バッファ111のうち、1つの命令バッファを選択して、選択した命令バッファをデコーダ130に接続する。セレクタ120が選択する命令バッファは、スレッドスケジューラ160によって制御される。
The
デコーダ130は、セレクタ120から出力される第0命令バッファ110または第1命令バッファ111の命令を解読し、解読結果を実行部140に送出する。
The
第0レジスタセット150は、複数の汎用レジスタ、システムレジスタ(権限情報を含む)などを含む。第1レジスタセット151は、複数の汎用レジスタ、システムレジスタ(権限情報を含む)などを含む。 The zeroth register set 150 includes a plurality of general-purpose registers, system registers (including authority information), and the like. The first register set 151 includes a plurality of general-purpose registers, system registers (including authority information), and the like.
セレクタ121は、第0レジスタセット150または第1レジスタセット151を選択し、選択したレジスタセットのデータを実行部140へ送る。セレクタ122は、第0レジスタセット150または第1レジスタセット151を選択し、実行部140による実行結果を表わすデータを選択したレジスタセットへ送る。
The
実行部140は、デコーダ130から送られる解読された命令を実行する。実行部140は、演算の種類に応じて第0レジスタセット150または第1レジスタセット151に記憶されたデータに対して演算を行う。演算の内容は、加算、乗算、除算、ロード、ストア、または分岐などであり、実行部140は、それぞれの演算に応じた回路を含む。ロード(もしくはストア)の場合、実行部140からデータバス170にアドレスを出力して主記憶部102からデータを読込む(もしくは書込む)。読み込んだデータは第0レジスタセット150または第1レジスタセット151に格納する。実行部140が使用するレジスタセットは、セレクタ121と122によって選択される。セレクタ121、122はスレッドスケジューラ160によって制御される。
The
スケジュールレジスタ180は、図2に示すようなスケジュールテーブル200を記憶する。スケジュールテーブル200の各エントリには、番号が付されているとともに、実行するスレッド番号が設定される。スケジュールテーブル200は、15個のエントリを有し、15個のサイクルについて、実行するスレッドを定める。 The schedule register 180 stores a schedule table 200 as shown in FIG. Each entry in the schedule table 200 is assigned a number and a thread number to be executed. The schedule table 200 has 15 entries, and defines threads to be executed for 15 cycles.
スケジュールテーブル200は、第0〜第9のエントリを含むコアスケジュールテーブル201と、第10〜第14のエントリを含む補填用スケジュールテーブル202とを含む。 The schedule table 200 includes a core schedule table 201 including the 0th to 9th entries and a compensation schedule table 202 including the 10th to 14th entries.
コアスケジュールテーブル201は、コア期間に実行されるスレッドを定める。コアスケジュールテーブル201は、スケジュール調整部192以外のOSまたはハイバーバイザによって設定される。たとえば、実行部140が、スレッド0およびスレッド1の実行順序および実行比率を定めるハイバーバイザを実行したときに、第14エントリのスレッドを実行後に、コアスケジュールテーブル201の各エントリのスレッド番号が設定される。
The core schedule table 201 defines threads to be executed during the core period. The core schedule table 201 is set by an OS or a hypervisor other than the
補填用スケジュールテーブル202は、補填用期間に実行されるスレッドを定める。補填用スケジュールテーブル202は、スケジュール調整部192によってスケジュール更新周期ごとに設定される。本実施の形態では、スケジュール更新周期は、15サイクルである。
The compensation schedule table 202 defines threads to be executed during the compensation period. The compensation schedule table 202 is set by the
スレッドスケジューラ160は、1サイクルごとにスケジュールテーブル200の1つのエントリを読み出す。スレッドスケジューラ160は、番号0のエントリから順にエントリを読み出し、最後のエントリを読み出したら、再度番号0のエントリから順に読み出す(循環すると記す)。
The
スレッドスケジューラ160は、スケジュールレジスタ180に設定された順番で各スレッドを1サイクル毎に切り替えて実行する。これにより、物理的に1つのプロセッサであるが、仮想的な複数のプロセッサを有するように振舞う。ここでの「サイクル」とは、1命令毎であってもよいし、まとまった命令ごとであっても良いし、一定時間であっても良い。
The
スレッドスケジューラ160は、読みだしたエントリに設定されたスレッド番号が「0」の場合には、セレクタ120に第0命令バッファ110からの命令の出力を選択させ、セレクタ121に第0レジスタセット150からのデータの読出しを選択させ、セレクタ122に第0レジスタセット150へのデータの書込みを選択させる。
When the thread number set in the read entry is “0”, the
スレッドスケジューラ160は、読みだしたエントリに設定されたスレッド番号が「1」の場合には、セレクタ120に第1命令バッファ111からの命令の出力を選択させ、セレクタ121に第1レジスタセット151からのデータの読出しを選択させ、セレクタ122に第1レジスタセット151へのデータの書込みを選択させる。
When the thread number set in the read entry is “1”, the
スレッドスケジューラ160は、読みだしたエントリに存在しないスレッド番号が設定されている場合、セレクタ120に第0命令バッファ110および第1命令バッファ111からのいずれの命令も選択させず、実行部140に、何も命令を実行させない(NOP(no operation)命令を実行する)。
If a thread number that does not exist in the read entry is set, the
実行サイクル数テーブル記憶部191は、図3に示すような実行サイクル数テーブル300を有する。実行サイクル数テーブル300の列301は、本実施の形態のスレッドの権限を示す。本実施の形態のスレッド0およびスレッド1は、「ハイパーバイザ権限」、「スーパーバイザ権限」、または「ユーザ権限」を有する。図3に示すように、実行サイクル数テーブル300の列302は、スレッド0用の実行サイクル数を格納する列である。実行サイクル数テーブル300の列303は、スレッド1用の実行サイクル数を格納する列である。実行サイクル数テーブル300の行311は、スレッド0、スレッド1のユーザ権限の実行サイクル数を格納する行である。 実行サイクル数テーブル300の行312は、スレッド0、スレッド1のスーパーバイザ権限の実行サイクル数を格納する行である。実行サイクル数テーブル300の行313は、スレッド0、スレッド1のハイパーバイザ権限の実行サイクル数を格納する行である。
The execution cycle number
実行サイクル数加算部190は、スレッドスケジューラ160と連携して、それぞれのスレッドにて実行されたハイパーバイザの実行サイクル数を実行サイクル数テーブル記憶部191に記録する。
The execution cycle
(実行サイクル数加算部190の動作)
図4は、実行サイクル数加算部190の各サイクルでの動作手順を示すフローチャートである。初期状態では、実行サイクル数テーブル記憶部191に記憶される実行サイクル数はすべて「0」である。
(Operation of the execution cycle number adding unit 190)
FIG. 4 is a flowchart showing an operation procedure in each cycle of the execution cycle
実行サイクル数加算部190は、スレッドスケジューラ160から実行しているスレッド番号を取得する(ステップS100)。
The execution cycle
次に、実行サイクル数加算部190は、実行しているスレッドがスレッド0の場合には(ステップS101でYES)、第0レジスタセット150からスレッド0の権限情報を取得する(ステップS102)。
Next, when the executing thread is the thread 0 (YES in step S101), the execution cycle
次に、実行サイクル数加算部190は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド0の取得した権限の実行サイクル数に「1」を加算する。実行サイクル数加算部190は、たとえば、取得した権限がハイパーバイザ権限であった場合、実行サイクル数テーブル300の列302の行313に記録された実行サイクル数に「1」を加算する(ステップS103)。
Next, the execution cycle
次に、実行サイクル数加算部190は、実行しているスレッドがスレッド0でない場合には(ステップS101でNO)、第1レジスタセット151からスレッド1の権限情報を取得する(ステップS104)。
Next, when the executing thread is not thread 0 (NO in step S101), the execution cycle
次に、実行サイクル数加算部190は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド1の取得した権限の実行サイクル数に「1」を加算する。実行サイクル数加算部190は、たとえば、取得した権限がハイパーバイザ権限であった場合、実行サイクル数テーブル300の列303の行313に記録された実行サイクル数に「1」を加算する(ステップS105)。
Next, the execution cycle
(スケジュール調整部192の動作)
スケジュール調整部192は、スレッドスケジューラ160と連携して、実行サイクル数テーブル300のスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、スケジュール更新周期ごとにスケジュールテーブル200の補填用スケジュールテーブル202を変更する。これによって、スケジュール調整部192は、ハイパーバイザ権限などのユーザ権限以外で動作したスレッドが、後の補填用期間において、補充的に実行されるように調整する。
(Operation of schedule adjustment unit 192)
The
図5は、第1の実施形態のスケジュール調整部192のスケジュール更新周期ごとの動作手順を示すフローチャートである。
FIG. 5 is a flowchart illustrating an operation procedure for each schedule update period of the
まず、スケジュール調整部192は、実行サイクル数テーブル記憶部191からスレッド0のハイパーバイザ権限の実行サイクル数n0を取得する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313に記録された実行サイクル数n0を取得する(ステップS200)。
First, the
次に、スケジュール調整部192は、実行サイクル数テーブル記憶部191からスレッド1のハイパーバイザ権限の実行サイクル数n1を取得する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313に記録された実行サイクル数n1を取得する(ステップS201)。
Next, the
次に、スケジュール調整部192は、ステップS200で取得した実行サイクル数n0と、ステップS201で取得した実行サイクル数n1との総和N(=n0+n1)を求める(ステップS202)。
Next, the
次に、スケジュール調整部192は、求めた総和Nが、補填用スケジュールテーブル202のエントリ数Mと同等もしくは少ないか判断する。
Next, the
判断した結果、同等もしくは少ない場合(ステップS203のYESの場合)、ステップS204に進む。判断した結果、多い場合(ステップS203のNOの場合)、ステップS220に進む。 If the result of the determination is equal or less (YES in step S203), the process proceeds to step S204. As a result of the determination, if there are many (NO in step S203), the process proceeds to step S220.
ステップS203でYESの場合は、スケジュール調整部192は、補填用スケジュールテーブル202の第10エントリを起点としてステップS200で取得した実行サイクル数n0個のエントリに「0」を設定する(ステップS204)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記録された実行サイクル数テーブル300におけるスレッド0のハイパーバイザ権限の実行サイクル数を0に設定する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313の実行サイクル数を0に設定する(ステップS205)。
If YES in step S203, the
次に、スケジュール調整部192は、補填用スケジュールテーブル202におけるステップS204にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS201で取得した実行サイクル数n1個のエントリに「1」を設定する(ステップS206)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド1のハイパーバイザ権限の実行サイクル数を0に設定する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313の実行サイクル数を0に設定する(ステップS207)。
Next, the
次に、スケジュール調整部192は、補填用スケジュールテーブル202に残りのエントリがある場合には、ステップS206にて「1」追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS208)。
Next, when there are remaining entries in the supplementary schedule table 202, the
ステップS203でNOの場合は、スケジュール調整部192は、補填用スケジュールテーブル202のエントリ数MとステップS202で求めた実行サイクル数の総和Nとの割合R(=M/N)を計算する(ステップS220)。
If NO in step S203, the
次に、スケジュール調整部192は、割合Rに基づいて、スレッド0のハイパーバイザ権限の実行サイクル数n0を修正した修正実行サイクル数n0′(=n0×R)を算出する。この算出において、小数点以下は切り捨てされる(ステップS221)。
Next, based on the ratio R, the
次に、スケジュール調整部192は、割合Rに基づいて、スレッド1のハイパーバイザ権限の実行サイクル数n1を修正した修正実行サイクル数n1′(=n1×R)を算出する。この算出において、小数点以下は切り捨てされる(ステップS222)。
Next, the
次に、スケジュール調整部192は、補填用スケジュールテーブル202のエントリ10を起点としてステップS221で算出した修正実行サイクル数n0′個のエントリに「0」を設定する(ステップS223)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を修正実行サイクル数n0′だけ減じる。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313の実行サイクル数から修正実行サイクル数n0′を減算して、減算した値で上書きする(ステップS224)。
Next, the
次に、スケジュール調整部192は、補填用スケジュールテーブル202においてステップS223にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS222で取得した修正実行サイクル数n1′個のエントリに「1」を設定する(ステップS225)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を修正実行サイクル数n1′だけ減じる。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313の実行サイクル数から修正実行サイクル数n1′を減算して、減算した値で上書きする(ステップS226)。
Next, the
次に、スケジュール調整部192は、補填用スケジュールテーブル202の残りのエントリがある場合には、すなわちステップS226にて「1」追加した最後のエントリの直後のエントリを起点として最後のエントリ(エントリ14)まで、「−1」を設定する(ステップS227)。
Next, when there is a remaining entry in the supplementary schedule table 202, that is, the
(スケジュール調整の第1の例)
図6は、第1の実施形態におけるスケジュール調整の第1の例を説明するための図である。
(First example of schedule adjustment)
FIG. 6 is a diagram for explaining a first example of schedule adjustment in the first embodiment.
ステップS200にて取得したスレッド0の実行サイクル数n0が「0」とする。
ステップS201にて取得したスレッド1の実行サイクル数n1が「3」とする。
It is assumed that the number of execution cycles n0 of the
The number of execution cycles n1 of the
ステップS202にて総和Nが「3」となる。その結果、ステップS203において、N≦M(=5)となり、ステップS204に進む。 In step S202, the sum N is "3". As a result, in step S203, N ≦ M (= 5), and the process proceeds to step S204.
ステップS204では、n0が「0」によって、補填用スケジュールテーブル202には「0」が設定されない。 In step S204, n0 is “0”, and “0” is not set in the compensation schedule table 202.
ステップS205では、n0が「0」によって、スレッド0のハイパーバイザ権限の実行サイクル数は「0」のまま変化しない。
In step S205, when n0 is “0”, the number of execution cycles of the hypervisor authority of
ステップS206では、n1が「3」によって、補填用スケジュールテーブル202の「3」個のエントリ(第10、第11、第12エントリ)には「1」が設定される。 In step S206, “1” is set in “3” entries (tenth, eleventh, and twelfth entries) of n1 in the compensation schedule table 202 because n1 is “3”.
ステップS207では、n1が「3」によって、スレッド1のハイバーバイザ権限の実行サイクル数が「0」に設定される。
In step S207, n1 is set to “3”, and the number of execution cycles of the hypervisor authority of
ステップS208では、補填用スケジュールテーブル202の残りのエントリである第13〜第14エントリに「−1」が設定される。 In step S <b> 208, “−1” is set in the thirteenth to fourteenth entries, which are the remaining entries in the compensation schedule table 202.
(スケジュール調整の第2の例)
図7は、第1の実施形態におけるスケジュール調整の第2の例を説明するための図である。
(Second example of schedule adjustment)
FIG. 7 is a diagram for explaining a second example of schedule adjustment in the first embodiment.
ステップS200にて取得したスレッド0の実行サイクル数n0が「4」とする。
ステップS201にて取得したスレッド1の実行サイクル数n1が「3」とする。
The number of execution cycles n0 of the
The number of execution cycles n1 of the
ステップS202にて総和Nが「7」となる。その結果、ステップS203において、N>M(=5)となり、ステップS220に進む。 In step S202, the sum N is "7". As a result, in step S203, N> M (= 5), and the process proceeds to step S220.
ステップS220では、R=5/7となる。
ステップS221では、4×5/7の整数部分が2なので、n0′は「2」となる。
In step S220, R = 5/7.
In step S221, since the integer part of 4 × 5/7 is 2, n0 ′ is “2”.
ステップS222では、3×5/7の整数部分が2なので、n1′は「2」となる。
ステップS223では、n0′が「2」によって、補填用スケジュールテーブル202の「2」個のエントリ(第10、第11エントリ)に「0」が設定される。
In step S222, since the integer part of 3 × 5/7 is 2, n1 ′ is “2”.
In step S223, “0” is set in “2” entries (tenth and eleventh entries) of the supplementary schedule table 202 because n0 ′ is “2”.
ステップS224では、n0′が「2」によって、スレッド0のハイパーバイザ権限の実行サイクル数は「4」から「2」だけ小さい「2」に設定される。
In step S224, n0 ′ is set to “2”, and the number of execution cycles of the hypervisor authority of
ステップS225では、n1′が「2」によって、補填用スケジュールテーブル202の「2」個のエントリ(第12、第13エントリ)には「1」が設定される。 In step S225, n1 'is "2", and "1" is set to "2" entries (twelfth and thirteenth entries) in the supplementary schedule table 202.
ステップS226では、n1′が「2」によって、スレッド1のハイバーバイザ権限の実行サイクル数が「3」から「2」だけ小さい「1」に設定される。
In step S226, n1 ′ is set to “2”, and the number of execution cycles of the hypervisor authority of
ステップS227では、補填用スケジュールテーブル202の残りのエントリである第14エントリに「−1」が設定される。 In step S227, “−1” is set in the fourteenth entry, which is the remaining entry in the compensation schedule table 202.
以上のように、本実施の形態では、スレッドごとに、ハイパーバイザ権限でハイパーバイザが動作した実行サイクル数を記録し、補填用期間において、各スレッドが、記録されたハイパー権限の実行サイクル数に応じたサイクル数だけ実行されるようにする。 As described above, in this embodiment, the number of execution cycles in which the hypervisor operates with the hypervisor authority is recorded for each thread, and each thread has the recorded number of execution cycles of the hyper authority in the compensation period. It will be executed for the corresponding number of cycles.
これによって、プログラムが本来動作する予定であったサイクル数の実行が補填され、プログラムへ配分された処理時間を維持することができる。 As a result, the execution of the number of cycles that the program originally intended to operate is compensated, and the processing time allocated to the program can be maintained.
なお、本実施の形態では、実行サイクル数テーブル300におけるスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めたが、これに限定するものではない。たとえば、実行サイクル数テーブル300におけるスレッドごとのユーザ権限およびスーパーバイザ権限の実行サイクル数を用いて、ハイパー権限の実行サイクル数を算出して、算出したハイパー権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めてもよい。 In the present embodiment, the thread to be set in the compensation schedule table 202 is determined based on the number of execution cycles of the hypervisor authority for each thread in the execution cycle number table 300. However, the present invention is not limited to this. For example, the execution cycle number of the hyper authority is calculated using the execution cycle number of the user authority and the supervisor authority for each thread in the execution cycle number table 300, and the compensation schedule is calculated based on the calculated execution cycle number of the hyper authority. A thread to be set in the table 202 may be determined.
[第1の実施の形態の変形例]
第1の実施形態では、実行サイクル数テーブル300におけるスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めたが、これに限定するものではない。実行サイクル数テーブル300におけるスレッドごとのスーパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202を設定するスレッド決めるものとしてもよい。
[Modification of First Embodiment]
In the first embodiment, the thread to be set in the compensation schedule table 202 is determined based on the number of execution cycles of the hypervisor authority for each thread in the execution cycle number table 300. However, the present invention is not limited to this. The thread for setting the supplementary schedule table 202 may be determined based on the number of execution cycles of supervisor authority for each thread in the execution cycle number table 300.
また、実行サイクル数テーブル300におけるスレッドごとのスーパーバイザ権限の実行サイクル数とハイパーバイザ権限の実行サイクル数の和に基づいて、補填用スケジュールテーブル202を設定するスレッド決めるものとしてもよい。 Further, the thread for setting the compensation schedule table 202 may be determined based on the sum of the number of execution cycles of supervisor authority and the number of execution cycles of hypervisor authority for each thread in the execution cycle number table 300.
[第2の実施形態]
第1の実施形態では、ハイパーバイザの動作サイクル数をそのスレッド分として追加するようにしたものである。本実施の形態では、さらに、スレッドの優先度や追加上限値によって、追加するサイクル数を変える。
[Second Embodiment]
In the first embodiment, the number of operation cycles of the hypervisor is added as the number of threads. In the present embodiment, the number of cycles to be added is further changed according to the priority of the thread and the additional upper limit value.
図8は、第2の実施形態のマルチスレッドプロセッサの概略構成の一例である。
第2の実施形態のマルチスレッドプロセッサが、第1の実施形態のマルチスレッドプロセッサと相違する点は、第2の実施形態のマルチスレッドプロセッサが、調整管理テーブル記憶部600を有する点と、第2の実施形態のスケジュール調整部592が第1の実施形態のスケジュール調整部192と機能が相違する点である。
FIG. 8 is an example of a schematic configuration of the multithread processor according to the second embodiment.
The multi-thread processor of the second embodiment is different from the multi-thread processor of the first embodiment in that the multi-thread processor of the second embodiment has an adjustment management
調整管理テーブル記憶部600は、図9のような調整管理テーブル593を記憶する。
調整管理テーブル593の列601は、スケジュール調整部592が利用するデータの種類を示す。「優先度」は、スレッド0の優先度である。優先度の値が大きいほど優先される(優先度が高い)。「上限サイクル数」は、スレッドでハイパーバイザが動作した場合に割当てるスロット数の上限である。スレッドごとに「上限サイクル数」を設けた理由は、補填用スケジュールテーブル202に優先度の高いスレッドばかりが設定されることによって、優先度の低いスレッドが補填用期間で実行されなくなるのを防止するためである。
The adjustment management
A
調整管理テーブル593の列602は、スレッド0用の優先度および上限サイクル数を格納する列であり、調整管理テーブル593の列603はスレッド1用の優先度および上限サイクル数を格納する列である。
The
調整管理テーブル593の行611は、スレッド0、スレッド1の優先度を格納する行である。調整管理テーブル593の行612は、スレッド0、スレッド1の上限サイクル数を格納する行である。
The row 611 of the adjustment management table 593 is a row for storing the priorities of the
(スケジュール調整部592の動作)
スケジュール調整部592は、スレッドスケジューラ160と連携して、実行サイクル数テーブル300のスレッドごとのハイパーバイザ権限の実行サイクル数と、調整管理テーブル593のスレッドごとの上限サイクル数および優先度に基づいて、スレッド更新周期ごとにスケジュールテーブル200の補填用スケジュールテーブル202を変更する。
(Operation of schedule adjustment unit 592)
The
図10〜図12は、第2の実施形態のスケジュール調整部592のスケジュール更新周期ごとの動作手順を示すフローチャートである。
10 to 12 are flowcharts illustrating an operation procedure for each schedule update period of the
まず、スケジュール調整部592は、実行サイクル数テーブル記憶部191の実行サイクル数テーブル300からスレッド0のハイパーバイザ権限の実行サイクル数n0を取得する。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313に記憶された実行サイクル数n0を取得する(ステップS500)。
First, the
次に、スケジュール調整部592は、実行サイクル数テーブル記憶部191の実行サイクル数テーブル300からスレッド1のハイパーバイザ権限の実行サイクル数n1を取得する。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313に記憶された実行サイクル数n1を取得する(ステップS501)。
Next, the
次に、スケジュール調整部592は、調整管理テーブル593からスレッド0の上限サイクル数を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列602、行612に記憶された上限サイクル数u0を取得する(ステップS502)。
Next, the
スケジュール調整部592は、ステップS500にて取得した実行サイクル数n0とステップS502で取得した上限サイクル数u0のうち小さい方を要求サイクル数s0として決定する(ステップS503)。
The
次に、スケジュール調整部592は、調整管理テーブル593からスレッド1の上限サイクル数を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列603、行612に記憶された上限サイクル数u1を取得する(ステップS504)。
Next, the
スケジュール調整部592は、ステップS501にて取得した実行サイクル数n1とステップS504で取得した上限サイクル数u1のうち小さい方を要求サイクル数s1として決定する(ステップS505)。
The
次に、スケジュール調整部592は、ステップS503で決定した要求サイクル数s0と、ステップS505で決定した要求サイクル数s1との総和S(=s0+s1)を求める(ステップS506)。
Next, the
次に、スケジュール調整部192は、求めた総和Sが、補填用スケジュールテーブル202のエントリ数Mと同等もしくは少ないか判断する。
Next, the
判断した結果、同等もしくは少ない場合(ステップS507のYESの場合)、ステップS510に進む。判断した結果、多い場合(ステップS507のNOの場合)、ステップS520に進む。 As a result of the determination, if equal or less (YES in step S507), the process proceeds to step S510. As a result of the determination, if there are many (NO in step S507), the process proceeds to step S520.
ステップS507でYESの場合は、スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS503で決定した要求サイクル数s0個のエントリに「0」を設定する(ステップS510)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル数s0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル数s0だけを減算して、減算した値で上書きする(ステップS511)。
If YES in step S507, the
次に、スケジュール調整部592は、補填用スケジュールテーブル202においてステップS510にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS505で決定した要求サイクル数s1個のエントリに「1」を設定する(ステップS512)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル数s1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル数s1だけを減算して、減算した値で上書きする(ステップS513)。
Next, the
次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS512にて「1」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS514)。
Next, when there is a remaining entry in the compensation schedule table 202, the
ステップS507でNOの場合、スケジュール調整部592は、調整管理テーブル593からスレッド0の優先度を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列602、行611に記憶されたスレッド0の優先度を取得する(ステップS520)。
If NO in step S507, the
次に、スケジュール調整部592は、調整管理テーブル593からスレッド1の優先度を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列603、行611に記憶されたスレッド1の優先度を取得する(ステップS521)。
Next, the
スケジュール調整部592が、スレッド0の優先度とスレッド1の優先度を比較し、スレッド0の優先度がスレッド1の優先度と同等もしくは高い場合には(ステップS522でYES)、ステップS530に進み、スレッド0の優先度がスレッド1の優先度よりも低い場合には(ステップS522でNO)、ステップS540に進む。
The
ステップS522でYESの場合、スケジュール調整部592は、補填用スケジュールテーブル202のエントリ数Mと要求サイクル数s0のうち小さい方を要求サイクル可能数p0に設定する(ステップS530)。
In the case of YES in step S522, the
スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS530で決定した要求サイクル可能数p0だけエントリに「0」を設定する(ステップS531)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル可能数p0だけを減算して、減算した値で上書きする(ステップS532)。
The
スケジュール調整部592は、補填用スケジュールテーブル202において現在の更新周期において、未設定のエントリがあるか否かを判断する。未設定のエントリがある場合には(ステップS533でYES)、ステップS534に進む。未設定のエントリがない場合には(ステップS533でNO)、処理を終了する。
The
ステップS533でYESの場合、スケジュール調整部592は、未設定のエントリの数MUと要求サイクル数s1のうち、小さい方を要求サイクル可能数p1として決定する(ステップS534)。
If YES in step S533, the
スケジュール調整部592は、補填用スケジュールテーブル202のステップS531にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS534で決定した要求サイクル可能数p1個のエントリに「1」を設定する(ステップS535)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル可能数p1だけを減算して、減算した値で上書きする(ステップS536)。
The
次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS537にて「1」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS537)。
Next, when there are remaining entries in the supplementary schedule table 202, the
ステップS522でNOの場合、スケジュール調整部592は、補填用スケジュールテーブル202のエントリ数Mと要求サイクル数s1のうち小さい方を要求サイクル可能数p1として決定する(ステップS540)。
In the case of NO in step S522, the
スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS540で決定した要求サイクル可能数p1個のエントリに「1」を設定する(ステップS541)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル可能数p1だけを減算して、減算した値で上書きする(ステップS542)。
The
スケジュール調整部592は、補填用スケジュールテーブル202に、現在の更新周期において、未設定のエントリがあるか否かを判断する。未設定のエントリがある場合には(ステップS543でYES)、ステップS544に進む。未設定のエントリがない場合には(ステップS543でNO)、処理を終了する。
The
ステップS543でYESの場合、スケジュール調整部592は、未設定のエントリの数MUと要求サイクル数s0のうち、小さい方を要求サイクル可能数p0として決定する(ステップS544)。
If YES in step S543, the
スケジュール調整部592は、補填用スケジュールテーブル202のステップS541にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS544で決定した要求サイクル可能数p0個のエントリに「0」を設定する(ステップS545)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル可能数p0だけを減算して、減算した値で上書きする(ステップS546)。
The
次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS547にて「0」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS547)。
(スケジュール調整の例)
図13は、第2の実施形態におけるスケジュール調整の例を説明するための図である。
Next, when there are remaining entries in the supplementary schedule table 202, the
(Example of schedule adjustment)
FIG. 13 is a diagram for explaining an example of schedule adjustment in the second embodiment.
ステップS500にて取得したスレッド0の実行サイクル数n0が「5」とする。
ステップS501にて取得したスレッド1の実行サイクル数n1が「2」とする。
The number of execution cycles n0 of the
The number of execution cycles n1 of the
ステップS502にて取得したスレッド0の上限サイクル数u0が「4」とする。
ステップS503にて、n0>u0より、要求サイクル数s0は「4」となる。
It is assumed that the upper limit cycle number u0 of the
In step S503, since n0> u0, the required cycle number s0 is “4”.
ステップS504にて取得したスレッド1の上限サイクル数u1が「2」とする。
ステップS505にて、n1=u1より、要求サイクル数s1は「2」となる。
The upper limit cycle number u1 of the
In step S505, since n1 = u1, the required cycle number s1 is “2”.
ステップS506にて、s0とs1の総和Sは「6」となる。
ステップS507にて、S>M(=5)によって、ステップS520に進む。
In step S506, the sum S of s0 and s1 is “6”.
In step S507, S> M (= 5), and the process proceeds to step S520.
ステップS520にて取得したスレッド0の優先度を「100」とする。
ステップS521にて取得したスレッド1の優先度を「40」とする。
The priority of the
The priority of the
ステップS522にて、スレッド0の優先度>スレッド1の優先度によって、ステップS530に進む。
In step S522, the process proceeds to step S530 depending on the priority of
ステップS530にて、s0<Mによって、要求サイクル可能数p0が「4」となる。
ステップS531にて、補填用スケジュールテーブル202の「4」個のエントリ(第10〜第13エントリ)が「0」に設定される。
In step S530, the required number of possible cycles p0 becomes “4” due to s0 <M.
In step S531, “4” entries (tenth to thirteenth entries) in the compensation schedule table 202 are set to “0”.
ステップS532にて、スレッド0のハイパーバイザ権限の実行サイクル数が「5」から「4」だけ小さい「1」に設定される。
In step S532, the number of execution cycles of the hypervisor authority of
ステップS533にて、未設定のエントリ(第14エントリ)があるので、ステップS534に進む。 In step S533, since there is an unset entry (14th entry), the process proceeds to step S534.
ステップS534にて、未設定のエントリ数MUが「1」なので、s1>MUによって、要求サイクル可能数p1が「1」となる。 In step S534, since the number of unset entries MU is “1”, the request cycle possible number p1 becomes “1” because s1> MU.
ステップS535にて、補填用スケジュールテーブル202の「1」個のエントリ(第14エントリ)が「1」に設定される。 In step S535, “1” entries (14th entry) in the compensation schedule table 202 are set to “1”.
ステップS536にて、スレッド1のハイパーバイザ権限の実行サイクル数は「2」から「1」だけ小さい「1」に設定される。
In step S536, the number of execution cycles of the hypervisor authority of
ステップS537では、補填用スケジュールテーブル202の残りのエントリがないので、「−1」が設定されない。 In step S537, since there are no remaining entries in the compensation schedule table 202, “−1” is not set.
以上のように、本実施の形態では、スレッドごとに、ハイパーバイザ権限でハイパーバイザが動作した実行サイクル数を記録し、補填用期間において、各スレッドが、記録されたハイパー権限の実行サイクル数、優先度および上限サイクル数に応じたサイクル数だけ実行されるようにする。 As described above, in this embodiment, for each thread, the number of execution cycles in which the hypervisor operates with the hypervisor authority is recorded, and in the compensation period, each thread records the number of execution cycles of the recorded hyper authority, Only the number of cycles corresponding to the priority and the upper limit number of cycles is executed.
これによって、第1の実施形態と同様に、プログラムが本来動作する予定であったサイクル数の実行が補填され、プログラムへ配分された処理時間を維持することができる。さらに、本実施の形態では、スレッド上で動作するプログラムの優先度順に補填されることによって、優先度の高いプログラムのデッドラインが守れるようにすることができる。また、本実施の形態では、補填されるスレッドのサイクル数に上限値を設定できるため、優先度の低いプログラムであっても補填することができ、プログラムの時間制約が守れない(デッドラインミス)ことが発生しにくくなる。
(第1および第2の実施形態の変形例)
スケジュールテーブル200、コアスケジュールテーブル201、補填用スケジュールテーブル202のエントリ数は、図2に示すものに限定されるものではなく、任意の数が可能である。
As a result, as in the first embodiment, the execution of the number of cycles that the program was originally supposed to operate is compensated for, and the processing time allocated to the program can be maintained. Furthermore, in this embodiment, the deadline of a program with a high priority can be protected by making up for the programs in order of priority of programs operating on threads. Further, in this embodiment, since an upper limit value can be set for the number of threads to be compensated, even a low priority program can be compensated, and the program time constraint cannot be observed (deadline miss). It becomes difficult to occur.
(Modification of the first and second embodiments)
The number of entries in the schedule table 200, the core schedule table 201, and the compensation schedule table 202 is not limited to that shown in FIG. 2, and any number is possible.
また、コアスケジュールテーブル201、補填用スケジュールテーブル202に含まれるエントリも、図2にしめすものに限定されるものではなく、図14(a)、図14(b)に示すものであってもよい。 Further, the entries included in the core schedule table 201 and the supplementary schedule table 202 are not limited to those shown in FIG. 2, but may be those shown in FIGS. 14 (a) and 14 (b). .
図14(a)に示すように、スケジュールテーブル230は、第5〜第14エントリを含むコアスケジュールテーブル231と、第0〜第4エントリを含む補填用スケジュールテーブル232とを含む。 As shown in FIG. 14A, the schedule table 230 includes a core schedule table 231 including the fifth to fourteenth entries and a compensation schedule table 232 including the zeroth to fourth entries.
また、 図14(b)に示すように、スケジュールテーブル240は、第0、1、3、4、6、7、9、10、12、13エントリを含むコアスケジュールテーブル241と、第2、第5、第8、第11、第14エントリを含む補填用スケジュールテーブル242とを含む。
As shown in FIG. 14B, the schedule table 240 includes a core schedule table 241 including
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
100 命令バス、101,102 主記憶部、110 第0命令バッファ、111 第1命令バッファ、120,121,122 セレクタ、130 デコーダ、140 実行部、145 命令フェッチ部、150 第0レジスタセット、151 第1レジスタセット、160 スレッドスケジューラ、170 データバス、180 スケジュールレジスタ、190 実行サイクル数加算部、191 実行サイクル数テーブル記憶部、192,592 スケジュール調整部、200,230,240 スケジュールテーブル、201,231,241 コアスケジュールテーブル、202,232,242 補填用スケジュールテーブル、300 実行サイクル数テーブル、593 調整管理テーブル、600 調整管理テーブル記憶部。
100 instruction bus, 101, 102 main storage unit, 110 0th instruction buffer, 111 1st instruction buffer, 120, 121, 122 selector, 130 decoder, 140 execution unit, 145 instruction fetch unit, 150 0th register set, 151
Claims (9)
サイクル単位で実行するスレッドを切り換えるスケジューラと、
オペレーティングシステムまたはハイパーバイザによって実行するスレッドが設定される第1期間以外の第2期間に実行するスレッドを設定するスケジュール調整部とを備え、
前記スケジュール調整部は、ユーザ権限以外の権限で動作したスレッドが、前記第2期間において、補充的に実行されるように調整する、マルチスレッドプロセッサ。 A multi-thread processor in which each thread operates with user authority or non-user authority every cycle,
A scheduler that switches threads to be executed in units of cycles;
A schedule adjustment unit configured to set a thread to be executed in a second period other than the first period in which a thread to be executed by the operating system or the hypervisor is set;
The schedule adjustment unit is a multi-thread processor that adjusts a thread that operates with an authority other than a user authority to be supplementarily executed in the second period.
所定数のサイクルについて、サイクルごとに実行するスレッドを定めたスケジュールを記憶する第2の記憶部と、
前記スケジュールは、前記第1期間で実行するスレッドを定めた第1スケジュールと、前記第2期間で実行するスレッドを定めた第2スケジュールとを含み、
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数に基づいて、前記第2スケジュールのスレッドを設定する、請求項1記載のマルチスレッドプロセッサ。 A first storage unit that stores, as a first authority cycle number, the number of cycles operated with a first authority other than the user authority for each thread;
A second storage unit that stores a schedule that defines threads to be executed for each cycle for a predetermined number of cycles;
The schedule includes a first schedule that defines threads to be executed in the first period, and a second schedule that defines threads to be executed in the second period,
The schedule adjustment unit sets a thread of the second schedule based on the first number of authority cycles for each of the threads stored in the first storage unit for each predetermined number of cycles. Item 4. The multithread processor according to Item 1.
前記スケジュール調整部は、所定数のサイクルごとに、前記第2スケジュールに設定した各スレッドの個数を前記第1の記憶部に記憶されている前記各スレッドの前記第1の権限サイクル数から減算する、請求項2記載のマルチスレッドプロセッサ。 An execution cycle number adding unit that increments the first authority cycle number of the thread stored in the first storage unit by one when there is a thread that operates with an authority other than the user authority for each cycle. Prepared,
The schedule adjustment unit subtracts the number of threads set in the second schedule from the first authority cycle number of each thread stored in the first storage unit for each predetermined number of cycles. The multi-thread processor according to claim 2.
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数と、前記第3の記憶部に記憶された前記スレッドごとの優先度に基づいて、前記第2スケジュールのスレッドを設定する、請求項2記載のマルチスレッドプロセッサ。 A third storage unit that stores the priority of each thread;
For each of the predetermined number of cycles, the schedule adjustment unit includes the first authority cycle number for each thread stored in the first storage unit and the thread stored in the third storage unit. The multi-thread processor according to claim 2, wherein a thread of the second schedule is set based on the priority.
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数と、前記第3の記憶部に記憶された前記スレッドごとの前記設定可能な個数の上限値に基づいて、前記第2スケジュールのスレッドを設定する、請求項2記載のマルチスレッドプロセッサ。 A third storage unit that stores an upper limit value of the number that can be set in the second schedule for each thread;
For each of the predetermined number of cycles, the schedule adjustment unit includes the first authority cycle number for each thread stored in the first storage unit and the thread stored in the third storage unit. The multi-thread processor according to claim 2, wherein a thread of the second schedule is set based on the upper limit value of the settable number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013022209A JP2014153860A (en) | 2013-02-07 | 2013-02-07 | Multi-thread processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2013022209A JP2014153860A (en) | 2013-02-07 | 2013-02-07 | Multi-thread processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014153860A true JP2014153860A (en) | 2014-08-25 |
Family
ID=51575690
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013022209A Pending JP2014153860A (en) | 2013-02-07 | 2013-02-07 | Multi-thread processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014153860A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019079530A (en) * | 2017-10-20 | 2019-05-23 | グラフコアー リミテッドGraphcore Limited | Scheduling tasks in multi-threaded processor |
US10606641B2 (en) | 2017-10-20 | 2020-03-31 | Graphcore Limited | Scheduling tasks in a multi-threaded processor |
-
2013
- 2013-02-07 JP JP2013022209A patent/JP2014153860A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019079530A (en) * | 2017-10-20 | 2019-05-23 | グラフコアー リミテッドGraphcore Limited | Scheduling tasks in multi-threaded processor |
US10606641B2 (en) | 2017-10-20 | 2020-03-31 | Graphcore Limited | Scheduling tasks in a multi-threaded processor |
US10956165B2 (en) | 2017-10-20 | 2021-03-23 | Graphcore Limited | Scheduling tasks in a multi-threaded processor |
US11550591B2 (en) | 2017-10-20 | 2023-01-10 | Graphcore Limited | Scheduling tasks in a multi-threaded processor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102592376B1 (en) | Apparatus and method for controlling command execution operation | |
US8695002B2 (en) | Multi-threaded processors and multi-processor systems comprising shared resources | |
US9436464B2 (en) | Instruction-issuance controlling device and instruction-issuance controlling method | |
JP5173714B2 (en) | Multi-thread processor and interrupt processing method thereof | |
JP4770664B2 (en) | Microprocessor and microcomputer using the same | |
US20060161924A1 (en) | Scheduling method, in particular context scheduling method, and device to be used with a scheduling method | |
JP7397858B2 (en) | Controlling access to the branch prediction unit for a sequence of fetch groups | |
US10853075B2 (en) | Controlling accesses to a branch prediction unit for sequences of fetch groups | |
JP4865016B2 (en) | Processor | |
JP2014153860A (en) | Multi-thread processor | |
JP5108690B2 (en) | DMA apparatus and DMA transfer method | |
US20200026650A1 (en) | Arithmetic processing device and arithmetic processing method | |
JP2020091751A (en) | Operation processing device and method for controlling the same | |
JP2008015562A (en) | Cache mistake/hit prediction | |
JP5843804B2 (en) | Arithmetic apparatus and error processing method | |
JP2009140130A (en) | Data processor, and method for controlling the same | |
JP7510253B2 (en) | Branch Predictor | |
JP2020077334A (en) | Arithmetic processing device and method for controlling arithmetic processing device | |
JP6160571B2 (en) | Data processing device | |
US20220156074A1 (en) | Electronic device and multiplexing method of spatial | |
JP2023508869A (en) | Controlling access to the branch prediction unit for a sequence of fetch groups | |
JP2012168725A (en) | Multi-thread processor | |
JP2010122787A (en) | Semiconductor integrated circuit and register address control device | |
US10817288B2 (en) | Combined instruction for addition and checking of terminals | |
KR20140057869A (en) | Method for controlling data read/write of embedded system of vehicle |